Re: parsing xml/string
| From: | Hank Marquardt | Date: | Wed, 16 Jan 2002 17:35:39 +0000 |
| Subject: | Re: parsing xml/string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80766@lists.php.net to get a copy of this message | ||
I guess I'd setup a global array $TAGS, create an entry in the array
with your open_tag handle, $TAGS[$tagnamepassedtohandler], use the data
handler to populate it $TAGS[$currenttag].=$data;
When you're done parsing the xml you have one big array with all the
tags that you can either use extract() on or use the $$ (variable
variable notation to create individual namespace entries.
On Wed, Jan 16, 2002 at 05:25:48PM -0000, Sandeep Murphy wrote:
> Hi,
>
> I have an xml output with tags like <sessionid>123</sessionid>
> <user>sands</sands>
>
> I could parse the output using expat to display it the way i want or as a
> string but what I need is to store the values separately in different
> variables like $id for sessionid, $user for user and so on.. to be
> manipulated later...
>
> Any suggestions??
>
> TIa,
>
> sandeep
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
Hank Marquardt <hank@yerpso.net>
http://web.yerpso.net
GPG Id: 2BB5E60C
Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
*** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD
*** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild
*** Beginning PHP -- Starts January 7, 2002
*** See http://www.hwg.org/services/classes