String matching with * ( that matches with any ) in any of the two strings | Function to check if the two strings can be matched or not ; if the string don 't have *  then character at that position  must be same. ; Driver Code
< ? php function doMatch ( $ A , $ B ) { for ( $ i = 0 ; $ i < strlen ( $ A ) ; $ i ++ ) if ( $ A [ $ i ] != ' * ' && $ B [ $ i ] != ' * ' ) if ( $ A [ $ i ] != $ B [ $ i ] ) return false ; return true ; } $ A = " gee * sforgeeks " ; $ B = " geeksforgeeks " ; echo doMatch ( $ A , $ B ) ; ? >