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!