Checking If a Variable Is an Object in PHP


Determine if a variable is an object using is_object().

Source Code

$obj = new stdClass;
if (is_object($obj)) {
    echo "This is an object.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments