/ Published in: PHP
alternative to print_r with syntax highlight using jquery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function test($var, $lang = 'php', $apenas_var = true, $die = true){ if($apenas_var) echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>'; echo '<script type="text/javascript" src="http://github.com/balupton/jquery-syntaxhighlighter/raw/master/scripts/jquery.syntaxhighlighter.min.js"></script>'; echo '<script type="text/javascript">$.SyntaxHighlighter.init();</script>'; echo ''; echo '<code id="printR" class="language-'.$lang.'" style="margin:50px 10%; width:80%;">'; if($lang == 'html') else echo '</code>'; if($die){ } }