PHP code example of xakepehok / scalarizer

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

    

xakepehok / scalarizer example snippets




$scalarizer = new \XAKEPEHOK\Scalarizer\Scalarizer(
    [DateTimeInterface::class => function (DateTimeInterface $dateTime) {
        return $dateTime->format('Y-m-d H:i:s');
    }], 
    true //use reflection
);

echo $scalarizer->scalarize($someValue);