Posted by Chung Leong on 10/26/05 02:39
Unlike compiled languages like Pascal, you don't need to define
structures. All you have to do is set the properties as though they
exist. Autovivication will take care of the rest.
Example:
<?php
$a->b->c = "Something";
$a->d[] = "Something else";
$a->b->e = "Gowno";
print_r($a);
?>
Result:
stdClass Object
(
[b] => stdClass Object
(
[c] => Something
[e] => Gowno
)
[d] => Array
(
[0] => Something else
)
)
Navigation:
[Reply to this message]
|