PHP code example of rame0 / chromephp

1. Go to this page and download the library: Download rame0/chromephp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rame0 / chromephp example snippets


// First __DIR__ . '/vendor/autoload.php';
$logger = new ChromePhp();

$logger->log('Some log message');
$logger->log('Some other log message');

$logger->warn('Some warning');
$logger->warn('Some other warning');

$logger->error('Some error');
$logger->error('Some other error');

$table = [];
for ($i = 0; $i < 5; $i++) {
    $row = [];
    for ($c = 1; $c < 3; $c++) {
        $row['Col ' . $c] = $i;
    }
    $table[] = $row;
}
$logger->table($table);

$ex = new InvalidArgumentException('Some exception!');
$logger->exception($ex);

try{
    new PDO('asdf');
}catch (PDOException $ex){
    $logger->exception($ex);
}