Skip to content

tohidplus/php-console-pretty-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

php-console-pretty-json

<?php

function jdd($data)
{
    $data = is_string($data) ? $data : json_encode($data,JSON_PRETTY_PRINT);
    $dbgt = debug_backtrace();
    echo "\e[42;1;37mJson dump info:\e[0m\n";
    echo "\e[0;33m" . $dbgt[0]['file'] . ':' . $dbgt[0]['line'] . "\e[0m" . PHP_EOL;
    echo "\e[1;36m" . $data . "\e[0m" . PHP_EOL.PHP_EOL;
    die();
}
 
 jdd(['key'=>'value']);

Output

output

About

Print outs data in console

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages