title: execute a script that outputs a result in a txt file or ini using the cmd line in php
body: <p>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. </p>
  
  <p>This is the script</p>
  
  <pre><code>&lt;?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!";
  
       } 
   ?&gt; 
  </code></pre>
  
  <p>And this is the command line<BR></p>
  
  <pre><code>C:\wamp\bin\php\php5.3.13&gt;php.exe -f "C:\wamp\www\hello.php"
  </code></pre>