i have xml file $file.xml
which includes the following
<?xml version="1.0"?>
<names><name>name1</name><name>name2</name><name>name3</name></names>
i need a way to check if <names>
has more than one child <name>
meaning that if the file has more than <name>name1</name>
whick means that if <name>name2</name>
or more exist to call a function.
i have tried the following
$file = "file.xml";
$result = file_get_contents($file);
if(@count(file($result)) > 1) {
//perform a function
}
the file_get_contents
already gave me the values name1
name2
and name3
but the if(@count(file($result)) > 1) {
did nothing
Thanks in advance