Hi,
To load a file and put it into a string you could use:
1)
<?
$myfile = "somefile.htm";
$myfilestring = @implode("",file($myfile));
?>
If you simply wants to know wether $substring is a part of $string or not, it's easier to use regular expressions.
<?
if (ereg($searchstring,$myfilestring )) {
// found
} else {
// not found
}
?>
ereg is case_sensitive if you want to search case-insensitive you can use eregi
or
2)
This example search the file without a string
<?
$myfile = file ('http://www.php.net');
while (list ($line_num, $line) = each ($fcontents)) {
$pos = strpos ($line, "my word");
// this returns the position
// do something :-)
}
?>
Hope this helps a little bit