Skip to content

Instantly share code, notes, and snippets.

@SecurityForUs
Created November 28, 2012 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SecurityForUs/4164231 to your computer and use it in GitHub Desktop.
Save SecurityForUs/4164231 to your computer and use it in GitHub Desktop.
<?php
/*** website stuff ***/
$error = array('id' => 1, 'text' => "let's pretend this array is an error that we want to disaply with <b roken HTML");
file_put_contents("/tmp/site.error", json_enode($error));
?>
<?php
/*** cli/console stuff ***/
$data = json_decode(file_get_contents("/tmp/site.error"));
// $data is now an array, and will display messages w/ broken HTML
print_r($data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment