Hello,
Just got started using preg_grep, so I'm not sure exactly what I'm doing wrong here. I have an array of values I want to look for ($values). And I have a file that I'm opening via FTP ($file). I thought I'd do this with a foreach loop to go through each one of the $values and search the array of $file each time:
foreach($value as $x) {
$value_str = preg_grep("'/".$x."/'",$file);
echo $x."<br>";
}
This isn't returning anything though, and if I change the "'/".$x."/'" segment to "/Test Value/" it finds what I'm looking for in $file. I added the echo $x line to be sure the value was in the $value array, and it does show on the page.
Any assistance, or other suggestions on how to accomplish this would be appreciated!