Hi.
I've got this simple method:

public function select($item,$value){
		$xp= new domxpath($this->doc);
		$query= "/users/user[{$item}/text()='{$value}']";
		$user= $xp->query($query);
var_dump($user instanceof DOMNodeList);
var_dump(is_null($user));
var_dump(isset($user));
	}

It works fine if there is a macth
but guest you it doesn't work if
there isn't one 😕
Could you explain me why ?
How can I do to check if there isn't a match ?
Thanks in advance.

Bye.

    Sorry it works I made a mistake
    in a other part of the script :o

    public function select($item,$value){
    		$xp= new domxpath($this->doc);
    		$query= "/users/user[{$item}/text()='{$value}']";
    		$user= $xp->query($query);
    		return (bool)count($user);
    	}
    

    Bye.

      Write a Reply...