how do you use preg_match to search for a string inside of a text file in PHP?

Mar

New member
I tried to do this but it doesn't work.
if (preg_match("/testFile.txt/",$a)) {
echo "A match was found.";
} else {
echo "A match was not found.";
}
I'm looking to see if a is part of the text file but when i run it won't detect it and says match was not found.
 
Back
Top