Skip to content

Instantly share code, notes, and snippets.

@norcross

norcross/pre-debug.php

Last active Oct 3, 2015
Embed
What would you like to do?
Wrap print_r in a 'pre' tag
<?php
function preprint($s, $return = false) {
$code = '<pre>';
$code .= print_r($s, 1);
$code .= '</pre>';
if ($return)
return $code;
else
print $code;
}
// USAGE: preprint( $array );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment