Quote:
Originally Posted by Dave
Yes, using the strpos function you can check whether it contains the string London.
Something like:
PHP Code:
if(strpos($string, 'London') === false) {
// continue
}
|
Thanks Dave at the moment I have this code.
PHP Code:
$roadfile = fopen("road.txt", "r") or die("Unable to open file!");
$output = fread($roadfile,filesize("road.txt"));
//preg replace code to go here:
//$output = preg_replace('London', '', $output);
fclose($roadfile);
So I am thinking with your code it will be
PHP Code:
$roadfile = fopen("road.txt", "r") or die("Unable to open file!");
$output = fread($roadfile,filesize("road.txt"));
//preg replace code to go here:
//$output = preg_replace('London', '', $output);
if(strpos($output, 'London') === false) {
// continue
//explode lines and stop on comma
}
fclose($roadfile);