PHP code example of enjoys / cartesian-iterator

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

    

enjoys / cartesian-iterator example snippets




$cartesianIterator = new \Enjoys\CartesianIterator();
$cartesianIterator->attachIterator(new \ArrayIterator([1,2]), 'test');
$cartesianIterator->attachIterator(new \ArrayIterator(['foo', 'bar']));

$result = iterator_to_array($cartesianIterator, false);
print_r($result);