PHP isn't recognising blank data or NULL data.
Posted: Thu Oct 19, 2006 5:46 am
I have this function:
But if I do at the end of the script I get:
How would it be possible for PHP to recognise if they are XML data or XML tags?
Regards,
Code: Select all
function contents($parser, $data){
static $i = 1;
global $contents;
if (!empty($data)) {
$contents[$i] = $data;
$i++;
}
}Code: Select all
print_r($contents);That data is obtained from an XML file parsed using xml_set_element_handler/xml_set_character_data_handler, and the blank entried are opening & closing tags.Array
(
[1] =>
[2] =>
[3] => stephen
[4] =>
[5] => 21
[6] =>
[7] =>
[8] =>
[9] => king kong
[10] =>
[11] => 1000
[12] =>
[13] =>
)
How would it be possible for PHP to recognise if they are XML data or XML tags?
Regards,