Last active
October 7, 2015 03:08
-
-
Save jmc734/3095269 to your computer and use it in GitHub Desktop.
Readable PHP Object Print
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 | |
/** | |
* @param mixed $expression The expression to be printed | |
* @param bool $return When true, output string will be returned rather than printed | |
* @return bool|string When the return parameter is true, the output string will be returned. | |
* Otherwise, the boolean true will be returned | |
*/ | |
function print_object($expression , $return = false){ | |
return highlight_string(print_r($expression, true), $return); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment