需求:在开发微信扫码自动登录时需要生成一个带参数的二维码,在调试过程中用正常的打印输出无法打印出我想要的参数,所以通过写文件的方式,把我要打印输出的结果写入文件中,具体代码如下。

ob_start();
echo '<pre>';
print_r("要输出的内容");
$str = ob_get_contents();
ob_end_clean();
$fp = fopen('/usr/share/nginx/html/xxx/xxxx/Admin/Controller/debug.txt','w+');
fwrite($fp,$str);
fclose($fp);

php开发过程案例一

相关文章:

  • 2021-05-28
  • 2021-08-01
  • 2022-12-23
  • 2021-08-07
  • 2021-09-14
  • 2021-12-18
  • 2021-11-17
  • 2021-10-06
猜你喜欢
  • 2021-12-18
  • 2021-12-12
  • 2021-11-30
  • 2021-11-12
  • 2022-01-02
  • 2021-09-20
相关资源
相似解决方案