MatchNameExample1.php

Go to the documentation of this file.
00001 <?php
00002 /* 
00003  * Examples using the match name list.
00004  *
00005  * @package Match
00006  */
00007 
00008 require_once( "_start.php" );
00009 
00010 function MatchNameExample1()
00011 {
00012         $objMatchName = new MatchName();
00013         $objMatchName->addItem( "Molly" );
00014         $objMatchName->addItem( "Armitage" );
00015         $objMatchName->addItem( "Wintermute" , "machine" );
00016         $objMatchName->addItem( "Case" , "hacker" );
00017         if ( $objMatchName->found( "Molly" ) !== true ) return false;
00018         if ( $objMatchName->match( "Molly" ) !== true ) return false;
00019         if( $objMatchName->match( "Wintermute" ) !== "machine" ) return false;
00020         if( $objMatchName->match( "Jackson" ) !== false ) return false;
00021         return true;
00022 }
00023 
00024 if( MatchNameExample1() )
00025 {
00026         print "ok!";
00027 }
00028 else
00029 {
00030         print "fail!";
00031 }
00032 ?>

Generated on Sat Apr 7 14:19:09 2012 for CodeToDiagram by  doxygen 1.5.9