PHP code example of b2r / simple-dump

1. Go to this page and download the library: Download b2r/simple-dump 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/ */

    

b2r / simple-dump example snippets


use b2r\Component\SimpleDump\SimpleDump;

// get as string
$server = SimpleDump::dump($_SERVER);

// echo
SimpleDump::display($_SERVER);

// Register global function `p` and `ps`
SimpleDump::init();

// get as string
$server = ps($_SERVER);

// echo
p($_SERVER);

// Register global function `p` and `ps`
b2r\Component\SimpleDump\SimpleDump::init();

# Store
$value = [
    'string' => 'string',
    'int'    => 1,
    'float'  => 1.0,
    'true'   => true,
    'false'  => false,
    'null'   => null,
];
$value['object'] = (object)$value;

# Echo
echo "------------------------------------------------------------\n";
p($value);
echo "------------------------------------------------------------\n";
var_dump($value);