/ Published in: PHP
a more useful way of printing php arrays in a nice readable format and able to decode serialized and json_encoded strings.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function debug_r($array=null,$dump=false,$string_type='serialize') { echo '<pre>'." "; { { if($dump) { }else{ } }else{ echo "Array empty"." "; } { switch($string_type) { default: case 'serialize': break; case 'json': break; } { if($dump) { }else{ } }else{ echo "Array empty"." "; } }else{ echo 'Invalid format'." "; } echo '</pre>'." "; }//end debug_r