note 8795 modified in xml_parse_into_struct by ronabop

From: Date: Mon, 02 Oct 2000 09:30:23 +0000
Subject: note 8795 modified in xml_parse_into_struct by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-5812@lists.php.net to get a copy of this message
What wasn't talked about here was how to access individual items of the new array of objects. It is actually quite simple but I didn't find the correct documentation any any of the books I have or on the site. To access an element of an object under normal conditions: $a = new MyObject; print $a->$myvar; But to access the object's variables when the object is part of an array you must drop the leading "$" of the variable or it will not access it. $a[0] = new MyObject; print $a[0]->myvar; Is the proper syntax. Hope this helps someone out there. It took me a day to learn this. Charlie http://www.php.net/manual/function.xml-parse-into-struct.php

« previous php.notes (#5812) next »