Page 2 of 2

Posted: Sat Mar 04, 2006 8:44 pm
by a94060
o my god,i swear to god i was looking at the php site about strpos,but i did not know how to implement it so i did not say anyhting 8O

Posted: Sun Mar 05, 2006 12:07 am
by JAB Creations
This still hasn't been solved and I want to be the only person making guesses in the dark. :?

Posted: Sun Mar 05, 2006 8:46 am
by JAB Creations
Ok...someone suggested this in a different forum but I get a false positive.

In this example it incorrectly echos that the string was found even though I have removed it.

test.php

Code: Select all

<html><head></head><body>
<?php
$fh = fopen('test.php', "rb");
$file = fread($fh, filesize('test.php'));
fclose($fh);
if(strpos($file, "<!--stuff-->")!== false)
{echo "string found";}
else
{echo "string not found";}
?></body></html>
Any ideas?

John