Is there a way to determine if a class has been loaded by passing a name to a function like is_class()?
Example:
<?php
class stuff
{
function stuff()
{
print "Stuff!!!!";
}
}
function createobject( $classname )
{
// Has the class been defined?
if ( is_class( $classname ) )
{
// Yes, create the object
$objstr = '$obj = new stuff';
eval( $objstr );
}
else
{
// Not found!
$obj = "";
}
// Return the results...
return $obj
}
$myobj = createobject("stuff");
?>