All pastes #183095 Raw Edit

fluffle

public php v1 · immutable
#183095 ·published 2006-09-26 16:17 UTC
rendered paste body
<?phpfunction debug($var, $val){                                                                                                                                               echo "***DEBUGGING\nVARIABLE: $var\nVALUE:";   if (is_array($val) || is_object($val) || is_resource($val)) {                                                                                    print_r($val);                                                                                                                           } else {                                                                                                                                         echo "\n$val\n";                                                                                                                         }                                                                                                                                                echo "***\n";                                                                                                                            }                                                                                                                                                                                                                                                                                      $c = mysql_connect();                                                                                                                        $host = $_SERVER["SERVER_NAME"];                                                                                                                                                                                                                                                          call_user_func_array('debug', array("host", $host));                                                                                         call_user_func_array('debug', array("c", $c));                                                                                               call_user_func_array('debug', array("_POST", $_POST));                                                                                       ?>                                                                                                                                           use Data::Dumper;                                                                                                                            my $debug = sub {                                                                                                                                my ($var, $val) = @_;                                                                                                                        print "***DEBUGGING\nVARIABLE: $var\nVALUE:\n";                                                                                              print Dumper($val);                                                                                                                      }                                                                                                                                            $debug->("host", $host);