try learning about: XML parser functions

-elias
http://www.kameelah.org/eassoft

"Jan Grafström" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
> I have this xml:
> <list>
> <vara>car</vara>
> <bskr>ford</bskr>
> <price>3600</price>
> <nr>8888</nr>
> </list>
> ---------
> and this php:
> $filename = "list.xml";
> $fp = fopen($filename, "r");
> $string = fread($fp, filesize($filename));
> $string = strip_tags($string);
> $refined_string = explode(" ", $string);
> if (in_array($needle." ", $refined_string)) {
>     print "found";
>     } else {
>     print "notfound";
> }
> fclose ($fp);
> -------
> I always get notfound when I set $needle to a word inside the xml-file.
> My script doesn´t work.
> Is it possible also to write a script wich can find the word "ford" if
> You only ask for "for"?
> I have just started to learn about php search and I am very thankful for
> any help.
>
> Regards
> Jan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to