PHP Wildcard usage in searching text files
Posted: Tue Dec 20, 2005 11:57 am
I've done extensive searching, and every topic on wildcards shows how they work with SQL or in a file system. But I'm trying to use a wild card to search (using strstr()) a text file for the locations of DATES, with the format: xx/xx/xx. Here's the code:
I've tried #, *, %, with and without single and double quotes (without the quotes, PHP won't parse it). Every time I DO use the quotes, it's going to look for a literal # or * or %! Its a loose loose situation. How would I go about syntaxing the wildcards in this situation?
Code: Select all
<? if (strstr($TextData, "##/##/##")){
echo "A date has been found";}
echo strstr($TextData, "##/##/##");?>