Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php best debugging functions


I find it very useful to print out to the browsers console instead of just var_dumping:

function console_log( $data ){
  echo '<script>';
  echo 'console.log('. json_encode( $data ) .')';
  echo '</script>';
}

Usage:
$myvar = array(1,2,3);
console_log( $myvar ); // [1,2,3]
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #debugging #functions
ADD COMMENT
Topic
Name
9+9 =