tags:

views:

40

answers:

2

I am trying to figure out how to create a function where I can pass in two strings, one with wildcards and another that is checked to see if it matches the wildcard string.

$wildcard_string = '*.example.com/some/path/*';
$test_string = 'dev.example.com/some/path/art123.html';

function test_wildcard_match($wildcard_string, $test_string){

  //return true or false

}
+7  A: 

fnmatch()

Ignacio Vazquez-Abrams
Wow, that is great. I am always amazed at the number of built in functions in php.
RobKohr
+2  A: 

http://ca.php.net/manual/en/function.fnmatch.php