国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > PHP > 正文

通過Email發(fā)送PHP錯(cuò)誤的方法

2024-05-04 23:37:59
字體:
供稿:網(wǎng)友

這篇文章主要介紹了通過Email發(fā)送PHP錯(cuò)誤的方法,實(shí)例分析了php錯(cuò)誤的讀取及通過php發(fā)送Email的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了通過Email發(fā)送PHP錯(cuò)誤的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

 

 
  1. <?php 
  2. // Our custom error handler 
  3. function nettuts_error_handler($number, $message, $file, $line, $vars){ 
  4. $email = " 
  5. <p>An error ($number) occurred on line 
  6. <strong>$line</strong> and in the <strong>file: $file.</strong> 
  7. <p> $message </p>"; 
  8. $email .= "<pre>" . print_r($vars, 1) . "</pre>"
  9. $headers = 'Content-type: text/html; charset=iso-8859-1' . "/r/n"
  10. // Email the error to someone... 
  11. error_log($email, 1, 'you@youremail.com', $headers); 
  12. // Make sure that you decide how to respond to errors (on the user's side) 
  13. // Either echo an error message, or kill the entire project. Up to you... 
  14. // The code below ensures that we only "die" if the error was more than 
  15. // just a NOTICE. 
  16. if ( ($number !== E_NOTICE) && ($number < 2048) ) { 
  17. die("There was an error. Please try again later."); 
  18. // We should use our custom function to handle errors. 
  19. set_error_handler('nettuts_error_handler'); 
  20. // Trigger an error... (var doesn't exist) 
  21. echo $somevarthatdoesnotexist; 

希望本文所述對(duì)大家的php程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 清镇市| 江都市| 柯坪县| 从江县| 潢川县| 成武县| 根河市| 普宁市| 金沙县| 宽城| 张家川| 屏边| 张掖市| 赤峰市| 收藏| 利川市| 十堰市| 桦甸市| 台东市| 麻城市| 天峻县| 台前县| 会同县| 萨迦县| 彭水| 青田县| 沭阳县| 衢州市| 肃宁县| 娄烦县| 西畴县| 吉水县| 赞皇县| 淮阳县| 长顺县| 平凉市| 马龙县| 揭阳市| 逊克县| 吉林省| 榆林市|