Page 1 of 1

check if object exists

Posted: Sun Jul 25, 2004 3:36 pm
by phishncode
Hi everyone I just started using objects and I am really digging them. The most recent version of php (or just my code) allows serialization with no problem so that makes my life much better. What I do not know how to do is check if a specific variable is an object or not. I ask to display an object on the screen but, I only want to display it if the object has been created. Does anyone know how this would be done.

Posted: Sun Jul 25, 2004 4:05 pm
by d3ad1ysp0rk
I believe [php_man]empty[/php_man]() works for both variables and objects.

Or even try [php_man]is_object[/php_man]().