note 117752 added to function.print-r
| From: | nuntius | Date: | Sat, 01 Aug 2015 22:45:49 +0000 |
| Subject: | note 117752 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203243@lists.php.net to get a copy of this message | ||
This is a happy medium between the overly complex usages and the simplistic. It prints out the debug
in a black and green monochrome look.
function formatDebug($value, $log=false) {
$contents = print_r($value, true);
$line="\n"
."<pre style=\"margin:18px 4px; padding:6px; text-align:left; background:#000;
color:#00FF00; font-family:courier;\">";
.htmlspecialchars($contents,ENT_QUOTES) // Escape HTML special chars
."</pre>";
if($log==true){
error_log($contents);//Send to log
}
return $line;
}
----
Server IP: 72.52.91.14
Probable Submitter: 69.247.168.141
----
Manual Page -- http://php.net/manual/en/function.print-r.php
Edit -- https://master.php.net/note/edit/117752
Del: integrated -- https://master.php.net/note/delete/117752/integrated
Del: useless -- https://master.php.net/note/delete/117752/useless
Del: bad code -- https://master.php.net/note/delete/117752/bad+code
Del: spam -- https://master.php.net/note/delete/117752/spam
Del: non-english -- https://master.php.net/note/delete/117752/non-english
Del: in docs -- https://master.php.net/note/delete/117752/in+docs
Del: other reasons-- https://master.php.net/note/delete/117752
Reject -- https://master.php.net/note/reject/117752
Search -- https://master.php.net/manage/user-notes.php