Re: fscanf

From: Date: Mon, 12 Mar 2001 15:48:44 +0000
Subject: Re: fscanf
Groups: php.general 
Request: Send a blank email to php-general+get-43480@lists.php.net to get a copy of this message
01-03-13 05:00:01, "Yasuo Ohgaki" <yohgaki@hotmial.com> wrote: >I think fscanf() is line oriented in C, isn't it? (I haven't used fscanf() for a >long time, I'm not 100% sure w/o reference.) no, i'm sure in c fscanf reads the next string available, not first string in next line >Your $buffer should only have "lenin". i agree. in first iteration buffer should contain "lenin", but in second the content should be "lives", not "forever", but is "forever" and i dont know why and i'm angry about it :-) >while (fscanf($file,"%s %s",$buf1,buf2)) >You should get "lives" in $buf2. i agree again, but i dont know how many stings do i have in one line. therefore i cant use fscanf($file,"n*%s",n*some_variables); besides it looks terrible... :-) regards, jakub zytka

« previous php.general (#43480) next »