MatchNameExample1.php
Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
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 ?>