Created
December 22, 2013 21:43
-
-
Save jeremyckahn/8088780 to your computer and use it in GitHub Desktop.
Function for var_dump'ing anything into into PHP's error log.
This file contains hidden or 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 | |
| // Adapted from: http://www.nolte-schamm.za.net/2011/05/php-var_dump-into-error-console_log/ | |
| function console_log ($obj) { | |
| ob_start(); | |
| var_dump($obj); | |
| $contents = ob_get_contents(); | |
| ob_end_clean(); | |
| error_log($contents); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love this bit of code. Use it all the time. Thank you very much.