Created
November 21, 2013 07:58
-
-
Save sebmih/7577579 to your computer and use it in GitHub Desktop.
A script that should decode JSON events.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$handle = @fopen('./tmp/dump.log', "r"); | |
if ($handle) | |
{ | |
// read till the end of the file | |
while (!feof($handle)) | |
{ | |
// read a line from the file | |
$line = fgets($handle, 4096); | |
// decode the json -> assoc. array | |
$decoded_line = json_decode($line, true); | |
?> | |
<p><strong>Recipient: <?php echo $decoded_line['email'];?></strong></p> | |
<p>Date: <?php echo date('d M Y H:i:s A e', $decoded_line['timestamp']);?> </p> | |
<p>Event: <?php echo $decoded_line['event'];?></p> | |
<?php | |
} | |
// close the file | |
fclose($handle); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment