i want to run a simple line in my commandline in windows to run a script that reads ip addresses and i want it to out output in a text file.
This is the script
<?php
$lines = file('ipaddresses.ini', FILE_IGNORE_NEW_LINES);
foreach($lines as $line){
echo $line;
$host = $line;
echo("Ping Output:");
system("ping -n 4 $host",$result);
if ($result == 0)
echo "Ping successful!";
else
echo "Ping unsuccessful!";
}
?>
And this is the command line
C:\wamp\bin\php\php5.3.13>php.exe -f "C:\wamp\www\hello.php"
Saving the output to a file can be done through the command line. Append
> [name of file]to the command and it will then store all of the output from the script into the specified file name.