I want to dump request variables to a file for debugging. How's this possible?
<?php $req_dump = print_r($_REQUEST, TRUE); $fp = fopen('request.log', 'a'); fwrite($fp, $req_dump); fclose($fp);
Untested but should do the job, just change request.log to the file you want to write to.
I think nowadays this method is easier and faster:
$req_dump = print_r($_REQUEST, true); $fp = file_put_contents('request.log', $req_dump, FILE_APPEND);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With