Well some resources for learning it first as these are usually the best
source of information:
Tutorials:
http://www.phpfreaks.com/tutorials.php
http://www.php-editors.com/articles/simple_php_classes.php
Examples:
http://www.phpclasses.org
I really recomend reading and following these as it will undoubtably
help with learning OOP with PHP/MySQL.
As a simple example here is a class, functions and how to use:
?PHP
// class.inc.php
class TestOOP
{
function ChkPHPFuncs( $function_name )
{
if( empty( $function_name ) ) {
return 1;
} else {
if( !function_exists( $function_name ) ) {
return 1;
} else {
return 0;
}
}
}
}
?
To use within a script:
?PHP
//include our class file so lib is available
include 'class.inc.php';
// check for mcrypt functions compiled with php
$list = array( 'mcrypt_cbc', 'mcrypt_cfb', 'mcrypt_create_iv',
'mcrypt_decrypt', 'mcrypt_ecb', 'mcrypt_encrypt' );
// initialize class file so we may use functions from that class
$x = new TestOOP();
//now use $x as our handle for any function from within class file
for( $i = 0; $i count( $list ); $i++ ) {
echo $x-chkPHPFuncs( $list[$i] );
}
?
Also here are some resources from PHP.net for reference:
http://us3.php.net/zend-engine-2.php
http://www.php.net/oop
HTH
Jas
T K wrote:
Hi,
For a study purpose, I'm looking for a small open source program that works
in PHP-MySQL. In particular, I would like to see some examples with PHP 5
and Object-Oriented Programming (such as class, objects, and so on).
I'm looking for a small program, possibly like blog, wiki, forum and so on.
I've downloaded several programs, but most of them don't use
classes/objects.
I'm using PHP without OOP, but recently set out to learn OOP.
Any suggestions would be appreciated.
Tek
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php