Hi , I'm a freshman in PHP, can anyone give me any advices? I defied some simple classes, like "User", "Item"... in a general way , $obj = new User(); specially, I need to assign a Object via a class name . Now , my code : switch ($className) { case "User": return new User(); break ; case "Item": return new Item(); break ; default: break ; } I think that It's not a clever job. How to do it skillfully? Thank you for any advice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php