note 19929 deleted from function.is-a by didou
| From: | didou@php.net | Date: | Thu, 03 Jul 2003 14:19:29 +0000 |
| Subject: | note 19929 deleted from function.is-a by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51452@lists.php.net to get a copy of this message | ||
Note Submitter: php@electricsurfer.com
----
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);
}
}