FirefoxRocks 0 Report post Posted March 14, 2011 I have wrote a PHP program for the command line. Currently it is using STDIN for input, but in this case I need it to read from a file. How do I pass the file onto the program in an argument if I'm using the command line?Currently I execute my programs using:php -f ./myprogram.php Share this post Link to post Share on other sites
yordan 10 Report post Posted March 14, 2011 did you try this way :php -f ./myprogram.php <myfile.txtwhere "myfile.txt" has each item you entered (one line per input). Share this post Link to post Share on other sites