Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Shannon Wynter  >  Permutator  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Permutator
Generate permutations of elements of an array
Author: By
Last change:
Date: 2010-04-30 09:51
Size: 401 bytes
 

Contents

Class file image Download
<?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();