/ Published in: PHP
Expand |
Embed | Plain Text
function report($text = '', $ret = true, $_re = true) { foreach ($test[1] as $key => $val) { // evitamos.. { continue; } // simple... $args = preg_replace('/(\'|\"|"?)(.*?)\\1/', '<span style="color:green;white-space:nowrap">\\0</span>', $args); // "string's" $args = preg_replace('/(true|false|null)/i', '<span style="color:purple;font-weight:bold">\\0</span>', $args); // bool's $args = preg_replace('/\b[0-9]+\b/', '<span style="color:black;font-weight:bold">\\0</span>', $args); // INTs $args = preg_replace('/[a-z0-9_]+\(.*?\)/i', '<span style="color:gray">\\0</span>', $args); // array() $args = trim($args)? $args: $args.'<span style="color:black;font-weight:bold;font-style:italic">void</span>'; $out []= "\t<span style=\"color:gray\"> <span style=\"color:red\"><em>$val</em></span><strong>(</strong>$args<strong>)</strong>; </span>"; } if ( ! $ret) { echo $ret; } return $out; }
You need to login to post a comment.
