×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: jared xiao
Added: Jan 15, 2016 4:15 AM
Modified: Jan 15, 2016 4:16 AM
Views: 10
Tags: no tags
checkbug
  1. //加入
  2. function checkbug($filename,$data,$method="a",$iflock=1) {
  3.         touch($filename);
  4.         $handle=fopen($filename,$method);
  5.         if($iflock){
  6.                 flock($handle,LOCK_EX);
  7.         }
  8.         fputs($handle,$data);
  9.         if($method=="rb+") ftruncate($handle,strlen($data));
  10.         fclose($handle);
  11. }
  12. //加入结束
  13.  
  14. //写入开始
  15.         ob_start();
  16.         print_r($params);
  17.         $ob = ob_get_contents();
  18.         ob_end_clean();
  19.         checkbug("print.txt", $ob);
  20. //写入结束