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

How to print variables in text file during PHP debugging

怪我咯
怪我咯Original
2017-06-27 09:56:292570browse

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);


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!

Statement:
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