Using popen() to Pass Data to the column Application : popen « File Directory « PHP






Using popen() to Pass Data to the column Application

 
<html>
<head>
<title>Using popen() to Pass Data to the 'column' Command</title>
</head>
<body>
<div>
<?php
$products = array(
    array( "A", 2, "red" ),
    array( "B", 3, "blue" ),
    array( "C", 1, "pink" ),
    array( "D", 1, "orange" )
    );
$ph = popen( "column -tc 3 -s / > purchases/user3.txt", "w" )
  or die( "Couldn't open connection to 'column' command" );
foreach ( $products as $prod ) {
  fputs( $ph, join('/';, $prod). "\n");
}
pclose( $ph );
?>
</div>
</body>
</html>
  
  








Related examples in the same category

1.Using popen() and pclose()
2.Using popen() to Read the Output of the Unix who Command
3.Using popen() with nsupdate
4.Reading output from popen()
5.Opening a Process File Pointer with popen()
6.Opening a Unidirectional Pipe Using popen()
7.Redirecting standard output
8.Reading standard error