PHP code example of serendipity_hq / vardumper-cli-to-html

1. Go to this page and download the library: Download serendipity_hq/vardumper-cli-to-html 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/ */

    

serendipity_hq / vardumper-cli-to-html example snippets


$var = [
    'a simple string' => "in an array of 5 elements",
    'a float' => 1.0,
    'an integer' => 1,
    'a boolean' => true,
    'an empty array' => [],
];
dumpf(null, $var);
ddf(null, $var);

dumpf(['file' => 'dump_var', 'maxDepth' => 2], $var);
ddf(['file' => 'dump_var.html', 'maxDepth' => 5], $var);