note 19929 added to function.is-a
| From: | php at electricsurfer dot com | Date: | Fri, 15 Mar 2002 05:19:20 +0000 |
| Subject: | note 19929 added to function.is-a | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27829@lists.php.net to get a copy of this message | ||
Here is a 3 line PHP implementation that worked for me:
if (!function_exists('is_a'))
{
function is_a($object, $class_name)
{
$class_name = strtolower($class_name);
if (get_class($object) == $class_name) return TRUE;
else return is_subclass_of($object, $class_name);
}
}
--
http://www.php.net/manual/en/function.is-a.php
http://master.php.net/manage/user-notes.php?action=edit+19929
http://master.php.net/manage/user-notes.php?action=delete+19929
http://master.php.net/manage/user-notes.php?action=reject+19929