PHP code example of flexic / recaster

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

    

flexic / recaster example snippets


$recaster = new Flexic\Recaster\Recaster($inputObject);
$object = $recaster->toClass(TargetClass::class);

$recaster = new Flexic\Recaster\Recaster($inputObject);
$arrayOfObject = $recaster->toArray();