Hi,
I am new to PHP. I have the following code, which executes a command line netstat command and removes the headers and replaces white spaces with commas -
<?php
exec('netstat -n', $sts); //Runs the Netstat Command
unset ($sts[0]); //Removes the first line (Headings)
unset ($sts[1]); //Removes the second line (Arb Info)
$sts=preg_replace('/ +/', ',', $sts); //Removes white spaces and replaces with commas
?>
What I want to do is to put the final output into a file called c:\test.csv
Can someone please complete the aboce code for me to do this?
I am new to PHP. I have the following code, which executes a command line netstat command and removes the headers and replaces white spaces with commas -
<?php
exec('netstat -n', $sts); //Runs the Netstat Command
unset ($sts[0]); //Removes the first line (Headings)
unset ($sts[1]); //Removes the second line (Arb Info)
$sts=preg_replace('/ +/', ',', $sts); //Removes white spaces and replaces with commas
?>
What I want to do is to put the final output into a file called c:\test.csv
Can someone please complete the aboce code for me to do this?