class customException extends Exception{ ???public function errorMessage() ???{ ???????//error message ???????$errorMsg = ‘Error on line ‘.$this->getLine().‘ in ‘.$this->getFile() ???????????.‘: <b>‘.$this->getMessage().‘</b> ‘; ???????return $errorMsg; ???}}try{ ??throw ?new customException("error le ");}catch (customException $e){ ???//display custom message ???echo $e->errorMessage();}?>
php 异常
原文地址:http://www.cnblogs.com/php-linux/p/7815752.html