problem search in array
| From: | Jan Grafström | Date: | Thu, 03 May 2001 20:12:58 +0000 |
| Subject: | problem search in array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51320@lists.php.net to get a copy of this message | ||
Hi!
This file will not work for me.
I have tried in several ways and I want it to print "Got word" if it
find $word.
----
$filename = "test.xml";
$fp = fopen($filename, "r");
$string = fread($fp, filesize($filename));
$string = strip_tags($string);
$refined_string = explode(" ", $string);
if (in_array ($word, $refined_string)){
print "Got word";
}
fclose ($fp);
------
If You know what is wrong I am very thankful for help.
Regards
Jan