Can not do a strpos after a fgets
| From: | Lane Fowler | Date: | Tue, 11 Apr 2000 16:56:02 +0000 |
| Subject: | Can not do a strpos after a fgets | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13396@lists.php.net to get a copy of this message | ||
I can not seem to read in a like from a file and test to
see if it has a tag in it. It always returns back false.
Can some one tell me what is up with this code.
I have tried it with just memory varables and it works find
but when you load $buffer from a fgets the strpos command does
not seem to work.
------------ JUNK1.PHP --------------
<%
$templatefp = fopen("junk2.php","r");
while (!feof($templatefp)) {
$buffer = fgets($templatefp, 4096);
# echo $buffer;
$buffer = addslashes($buffer);
# Look for a terminator
echo $buffer."y";
if (!strpos($buffer,"#")){
echo " Has pound ";}else{echo " Not found";}
}
fclose ($templatefp);
%>
---------- JUNK2.PHP ---------------
#junk#
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.