note 56119 added to ref.xml
| From: | BinnyVA at osu1 dot php dot net | Date: | Wed, 24 Aug 2005 08:19:43 +0000 |
| Subject: | note 56119 added to ref.xml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94112@lists.php.net to get a copy of this message | ||
The 'xml2array' functions(see below) have a small problem - they will ignore the
Empty-element tags - ie. the tags that close themselves. An example...
<IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home"
/>
If you wish to access the attributes of these tags, use this code before calling the function.
<?php
$data = file_get_contents("atom.xml");
$data =
preg_replace('/<(\w+)([^>]*)\/>/s','<\1\2></\1>',$data);
$xml_data = xml2array($data);
?>
I have not modified the function in anyway. There are two versions(HansP's and guyemup's)
of the same function. This code was made for the older one - guyemup's function - but can be
used with the other variation with some slight modifications.
----
Manual Page -- http://www.php.net/manual/en/ref.xml.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56119
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56119&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56119&report=yes
Search -- http://master.php.net/manage/user-notes.php