So... I'm a newbie in php and I want to read every line from a file, execute my script and then cameback to read a new line and execute again the script. My script is about reading links from a target specified so I decided to make it to read a target from a file to learning something new.
Here's my code for reading every lines from a file
<?
$handle = fopen("targets.txt", "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
echo $line;
}
} else {
echo "Can't open the file.";
}
fclose($handle);
?>
and here is the script code:
$site = "http://www.example.com";
...script code...
so basicly I want for my $site variable to be every line from target.txt I tried to implement both like $site = "$line"; but it give me errors and I read something about return command... how should I build for my example?