Re: Easy way to grab a value out of XML?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux