Re: php search xml-file

From: Date: Mon, 09 Apr 2001 17:19:58 +0000
Subject: Re: php search xml-file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47735@lists.php.net to get a copy of this message
try learning about: XML parser functions -elias http://www.kameelah.org/eassoft "Jan Grafström" <jan@lillemanshus.com> wrote in message news:3AD15D5A.69E5BEE3@lillemanshus.com... > 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47735) next »