PHP Classes

File: example.php

Recommend this page to a friend!
  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: 13 years ago
Size: 401 bytes


Class file image Download

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

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

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

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