Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi Folks

I am trying find a way to check if an object is simplexml.

$test = new MyClass();
is_object($test); => return true
gettype($test); => return object

$simplexml = simplexml_load_file('some.xml');
is_object($simplexml); => return true
gettype($simplexml); => return object

But you know if you var_dump($simplexml) we get simplexml object

So How can identify a simplexml object?

I would like to suggest to core team create a function like



Re: is_simplexml?

macm escribió:
Quoted text here. Click to load it

is_subclass_of() should do the trick:

See also get_class():

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor al baño María:

Re: is_simplexml?

On Jan 7, 1:17 pm, "=C1lvaro G. Vicario"
Quoted text here. Click to load it


See also get_class():

Thanks a lot


Site Timeline