Friday, March 25, 2011

How Can You Add Attributes to an Object in PHP-Code Provided-Tutorial

Let' create another instance to see what happens:

$jude = new human();
< style="color: navy;" lang="EN-GB">$jane = new human();
< style="color: red;" lang="EN-GB">$jude-
>legs++; //increase legs by one
echo "Jude has " .$jude->legs." Legs
";
echo "Jane has " .$jane->legs." legs";
?>

No comments:

Post a Comment

PHP | PHP Books | PHP Tutorials | PHP Development