1.php异常处理:
1 <?php 2 header("content-type: text/html; charset=utf8"); 3 4 function at(){ 5 try{ 6 echo '异常处理 --->'; 7 throw new Exception('发生异常!aa'); 8 }catch(Exception $e){ 9 echo '铺货异常:'.$e->getMessage(); 10 } 11 } 12 13 at();
1 <?php 2 header("content-type: text/html; charset=utf8"); 3 4 function at(){ 5 try{ 6 echo '异常处理 --->'; 7 throw new \Exception('发生异常!aa'); 8 }catch(\Exception $e){ 9 echo '铺货异常:'.$e->getMessage(); 10 } 11 } 12 13 at();