国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 邵武市| 盖州市| 大足县| 策勒县| 霍城县| 如皋市| 北宁市| 任丘市| 文化| 泽普县| 长宁县| 博爱县| 建昌县| 福泉市| 原平市| 济源市| 德昌县| 子洲县| 峨山| 体育| 宜州市| 甘谷县| 离岛区| 忻州市| 东方市| 青岛市| 抚顺市| 米泉市| 凤山县| 临汾市| 娄底市| 晋中市| 阿图什市| 广宁县| 桦南县| 兴业县| 文山县| 东源县| 达拉特旗| 从江县| 新河县|