Mega Code Archive

 
Categories / Php / Development
 

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>