Re: Re[2]: [PHP] Using system

From: Date: Wed, 17 Sep 2003 15:01:08 +0000
Subject: Re: Re[2]: [PHP] Using system
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-162880@lists.php.net to get a copy of this message
Uros, Run the command from the shell prompt and check your grep against the output. Cheers, Rob. On Wed, 2003-09-17 at 10:49, Uros wrote: > Hello Robert, > > I think not > > here is my code > > #!/usr/local/bin/php -q > <?php > $ret = nslookup -timeout=3 www.myhost.com |grep "Non-existent > host/domain"; > ?> > > I always get automaticaly output. I also try to set implicit_flush to off, > use ob ob_... > > nothing works. > > best regards > > Wednesday, September 17, 2003, 4:16:10 PM, you wrote: > > RC> Backtick style gets you the output... > > RC> $passwords = cat /etc/passwd; > > RC> Cheers, > RC> Rob. > > > RC> On Wed, 2003-09-17 at 09:55, esctoday.com | Wouter van Vliet wrote: > >> Don't think there's one function for it .. Though, you may want to try the > >> output buffers. > >> > >> ob_start(); > >> ( .. Exec here ..) > >> $Var = ob_end_clean(); > >> > >> , > >> Wouter > >> > >> -----Original Message----- > >> From: Uros [mailto:uros.gruber@sir-mag.com] > >> Sent: Wednesday, September 17, 2003 3:18 PM > >> To: PHP General list > >> Subject: [PHP] Using system > >> > >> Hello! > >> > >> I'm pulling my hair. What is the right syntax to set output of some system > >> call to variable. > >> > >> I tried everything (system, shell_exec,exec) and always get output to > >> screen. > >> > >> Please help. > >> > >> PHP version 4.3.3 CLI > >> > >> -- > >> Best regards, > >> Uros -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'

« previous php.general (#162880) next »