Skip to content

Instantly share code, notes, and snippets.

@matesnippets
Created March 9, 2015 15:27
Show Gist options
  • Save matesnippets/2c6ad2414350cdc2b382 to your computer and use it in GitHub Desktop.
Save matesnippets/2c6ad2414350cdc2b382 to your computer and use it in GitHub Desktop.
PHP, print_r() helper function. Prints arrays out in a nice, formatted, human readable way.
/**
* Prints out array in human readable form, just a helper function
* @param array $arr The wanted array to be printed
* @return array The array in human readable form
*/
function printr_func($arr)
{
echo "<pre class='printr'><code>";
print_r($arr);
echo "</code></pre>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment