PHP Classes
Icontem

File: example4.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of zandor  >  anagrams  >  example4.php  
File: example4.php
Role: Example script
Content type: text/plain
Description: example
Class: anagrams
Generate anagrams from given words
 

Contents

Class file image Download
<?php

/*

class anagram
-------------
This example shows a faster filtering from
all anagrams, but implementation is a bit
more difficult.

Besides initials, this faster performance
can also perform anagrams forced by terminals:
in this case, the user should also add bonds
for any letter as in the code below,
where we are filtering all anagrams beginning
with 'BI' and ending with 'IT'.

*/

require_once( 'anagram.php' );

$anagrams = new anagram();

$anagrams->insert_word"biscuit" );

// insert the base-1 index of the letter
$anagrams->add_bond); // letter B
$anagrams->add_bond); // letter I
$anagrams->add_bond); // 0 means that any letter can be set here
$anagrams->add_bond); // 0 means that any letter can be set here
$anagrams->add_bond); // 0 means that any letter can be set here
$anagrams->add_bond); // letter I
$anagrams->add_bond); // letter T

$anagrams->set_save_filetrue ) ;
$anagrams->set_save_file_name"ex4.html" ) ;
$anagrams->go();

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products