note 48032 added to function.xml-parse-into-struct
| From: | memandeemail at gmail dot com | Date: | Thu, 09 Dec 2004 15:09:18 +0000 |
| Subject: | note 48032 added to function.xml-parse-into-struct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81591@lists.php.net to get a copy of this message | ||
a BREAK on right place, will be faster and bugprevent
/**
* @return bool
* @param xml_array $values
* @param xml_array[reference] $tags
* @desc Reconstruct xml_parse_into_struct to open and close concept
*/
function reconstruct_tag($values, &$tags) {
unset($return);
foreach ($tags as $tkey => $tvalue) {
foreach ($tvalue as $vvalue) {
if ($values[$vvalue]['type'] == 'open' or $values[$vvalue]['type']
== 'complete') {
$return[$tkey][] = $vvalue;
}
if ($values[$vvalue]['type'] == 'open') {
foreach ($tvalue as $tv_value) {
if ($values[$tv_value]['type'] == 'close'
and $values[$tv_value]['level'] == $values[$vvalue]['level']
and $tv_value > $vvalue) {
$return[$tkey][] = $tv_value;
break;
}
}
}
}
}
$tags = $return;
return (bool) $tags;
}
----
Manual Page -- http://www.php.net/manual/en/function.xml-parse-into-struct.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48032
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48032&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48032&report=yes
Search -- http://master.php.net/manage/user-notes.php