PHP code example of navarr / iterable-to-array

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

    

navarr / iterable-to-array example snippets




use Navarr\Utils\IterableToArray

// ...

$array = IterableToArray::convert($iterable);

// This replaces:

$array = is_array($iterable) ? $iterable : iterator_to_array($iterable);