Re: [PHP] use linux commands within php
> try this > > > system ("/usr/bin/wc -l $userfile> t.txt"); > > $fd =fopen('t.txt', 'r'); > $buffer=fgets($fd,8); > > echo ($buffer); > fclose($fd); > > ?> Or... if you really just want to count the number of lines in a file... do this: This offers the advantage of having the file loaded into an array, since... chances are you want to do something with it after you spit out how many lines are in it. Daniel J. Lashua -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] use linux commands within php
try this t.txt"); $fd =fopen('t.txt', 'r'); $buffer=fgets($fd,8); echo ($buffer); fclose($fd); ?> On Fri, 25 Jan 2002 11:41:44 -0800 (PST) toni baker <[EMAIL PROTECTED]> wrote: > How can I count the number of lines in the uploaded > file. ($userfile) > > What's wrong with the command below. Thanks > > $fp = popen ("usr/bin/wc -l $userfile", "r"); > > __ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- +---+ | Pablo Dall'Oglio _ | | Univates - IT Department °v° | | Linux User n. 223253 /(_)\| | The best source is the source code^ ^ | +---+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] use linux commands within php
How can I count the number of lines in the uploaded file. ($userfile) What's wrong with the command below. Thanks $fp = popen ("usr/bin/wc -l $userfile", "r"); __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]