Using popen() to Pass Data to the column Application : System Command « Development « 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>
<?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 / > data.txt", "w" )  or die( "Couldn't open connection to 'column' command" );
foreach ( $products as $prod )
    fputs( $ph, join('/', $prod)."\n");
pclose( $ph );
?>
</table>
</body>
</html>

           
       








Related examples in the same category

1.Porter scanner
2.Ping server
3.Execute shell command 'dir'
4.Ping command
5.Execute help command and check its output
6.Using exec() to Produce a Directory Listing
7.Calling the man Command
8.Using popen() to Read the Output of the UNIX who Command