Location: PHPKode > scripts > Permutator > example.php
<?php
include_once('Permutator.class.php');

// Create a list of things to run against
$list = array('dog', 'cat', 'horse', 'brid', 'tree');

// And a callback function
function echoit($list) {
        echo join(', ', $list) . "\n";
}

// Create a permutator
$obj = new Permutator($list, 'echoit');

echo "There are ", $obj->factors(), " possible permutations\n\n";

$obj->process();
Return current item: Permutator