Welcome Guest, Not a member yet? Register   Sign In
Log an Array


I'm constantly in need for a way to debug and log some Arrays.

I'd like to log it in the log file instead of having to use a var_dump.

I've added the following function to the Commun.php file of code_igniter, it works but it's probably ugly. If someone knows of a better way i'm interested ...

function log_array($level = 'error', $array, $php_error = FALSE)
    static $LOG;
    $config =& get_config();
    if ($config['log_threshold'] == 0)

    $LOG =& load_class('Log');    
    $LOG->write_log($level, $tab_debug, $php_error);


Messages In This Thread
Log an Array - by El Forum - 09-07-2007, 07:45 AM
Log an Array - by El Forum - 09-07-2007, 07:56 AM

Theme © iAndrew 2016 - Forum software by © MyBB