Created
March 14, 2018 08:48
-
-
Save yayMark/574758914011f15cfe0ed30299e968e4 to your computer and use it in GitHub Desktop.
PHP: output a variable in JSON format
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 | |
function spew($var) { | |
echo '<pre>'; | |
echo json_encode($var, JSON_PRETTY_PRINT); | |
echo '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment