Help with exec.

[email protected] (Paul Halliday)
Newsgroups php.general
Message-ID <[email protected]>
I need to pipe some data to an external application.

I have this:

while ($row = mysql_fetch_array($theData[0])) {
    $src_ip[] = $row[0];
    $dst_ip[] = $row[1];
    $sig_desc[] = $row[2];

    $rec ++;
    if ( $rec == $recCount ) {
            break;
    }
}

for ($i = 0; $i < sizeof($src_ip); $i++) {
    $tmpResult[] = "$sig_desc[$i],$src_ip[$i],$dst_ip[$i]\n";
}


The external program is called like:

cat results.csv | theprogram outputfilename

Is there a way mimic this w/o outputting $tmpResult to a file first?

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.