Home > Backend Development > PHP Tutorial > How to print variables in text file during PHP debugging

How to print variables in text file during PHP debugging

怪我咯
Release: 2023-03-11 07:30:01
Original
2639 people have browsed it

In some cases, it may not be possible to simply use ECHO or var_dump() to print out variables in the foreground for debugging. Then you can print the variables to a text file in the background for viewing. Paste a piece of code here as a memo.

file_put_contents("/test.txt", var_export($mydata,true)."\r\n",FILE_APPEND);
Copy after login


The above is the detailed content of How to print variables in text file during PHP debugging. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template