Wednesday, February 27, 2008

PHP 5 Touching OOP

i read and i read and im confuse. ok next chapter.

PHP5 OO Language

wow now im actually learn Object Oriented thingy.

class Person
Method :
setName($name)
getName()

Properties :
$name

and this is the code :

class Person {
private $name;

function setName($name) {
$this->name = $name;
}

function getName() {

}
};

$judy = new Person();
$judy->setName("Judy");

$joe = new Person();
$joe->setName("Joe");

print $judy->getName() . "\n" ;
print $joe->getName() . "\n" ;

itll print the name.

No comments:

Starting to Learn Wordpress

 I'm gonna start learning wordpress again. I know it's been a while and I'm using Blogger to write everything.  I don't know...