debug and inspect $_POST

php

Solution

Save the status of the `$_POST` array to a file using `var_export` (with the current `time()` to avoid overwrites), and inspect the file later.

file_put_contents( 'debug' . time() . '.log', var_export( $_POST, true));

Problem

Lets say that i have 2 pages: index.php and service.php index.php sends an http-post to service.php, containing a datestamp once every 5th minute. How would i debug the post variables on service.php? Obviously i cant just do a ``` if(isset($_POST['key'])) { var_dump($_POST['key']); } ``` since it wont exist when i enter the page. In ASP.NET i would just create a breakpoint, but how would i inspect the posted data in php? Thanks

Original source