lundi 30 janvier 2017

if node value empty else

I have following code but even if node value is empty or populated I get same echo = is not set or empty

In my header I include xml file which include $linkwebsite = $element->getElementsByTagName('linkwebsite')->item(0) ;

<?php
    if (!empty($linkwebsite)){
    echo 'not empty';
}
else{
    echo 'is not set or empty';
}
?>

Aucun commentaire:

Enregistrer un commentaire