Re: How to Get the Sub Classes of a Parent Class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/10/25 Raymond Irving <xwisdom@xxxxxxxxx>:

> I want to automatically initialize a specific sub class when the php page is loaded.
>
> I'm looking for a solution for php 5.1+ or anything that's optimized for 5.3

You may be able solve this with a simple class_exists() (pseudo-code ahead):

if(class_exists($var)) {
    $class = new $var;
} else {
    $class = new FourOhFour;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux