note 43728 modified in ref.simplexml by kennyt
| From: | kennyt@php.net | Date: | Sun, 18 Jul 2004 16:48:19 +0000 |
| Subject: | note 43728 modified in ref.simplexml by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73489@lists.php.net to get a copy of this message | ||
To test whether a child node exists I used the following code:
<?php
function child_exists($xml, $childpath)
{
$result = $xml->xpath($childpath);
if (count($result)) {
return true;
} else {
return false;
}
}
?>
--was--
To test whether a child node exists I used the following code:
function child_exists($xml, $childpath)
{
$result = $xml->xpath($childpath);
if (count($result)) {
return true;
} else {
return false;
}
}
http://php.net/manual/en/ref.simplexml.php