RE: [PHP] Convertig xml into array
| From: | Edward Kay | Date: | Tue, 27 Nov 2007 10:05:41 +0000 |
| Subject: | RE: [PHP] Convertig xml into array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265058@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Dave Goodchild [mailto:buddhamagnet@gmail.com]
> Sent: 27 November 2007 08:36
> To: PHP General list
> Subject: [PHP] Convertig xml into array
>
>
> Hi guys. I have the following XML file which I want to convert into a
> multidimensional array. I am using PHP5 so don't want to use
> SimpleXML as apparently there are issues with sessions and after
> conversion I want to pass this array into the session. Any ideas on
> the best and cleanest way to do this?
>
> <snip>
Hi Dave,
The issue with sessions is simply that SimpleXML objects do not persist in
sessions. To workaround this, just use the asXML() function so your XML is
stored as a string in the session. You can then recreate the SimpleXML
object from this string as and when you need it.
Edward