You are here: Re: [PHP] Easy way to grab a value out of XML? « PHP « IT news, forums, messages
Re: [PHP] Easy way to grab a value out of XML?

Posted by Richard Lynch on 04/06/05 07:05

On Fri, April 1, 2005 1:53 pm, Brian Dunning said:
> I've been looking at the XML commands and am feeling a bit overwhelmed.
> My needs are simple and I'm hoping there's an easy solution that I'm
> just missing. I have a hunk of well-formed XML in a variable, $xml, and
> it contains only one instance of <price>x.xx</price>. I just want to
> get the $price out of $xml. What's the simplest way?

Simplest?

$xml = file_get_contents('...');
$parts = explode('<price>', $xml);
$price = $parts[1];
$parts = explode('</price>', $price);
$price = $parts[0];

XML fans now all want to kill me, but there it is.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация