Posted by NC on 10/09/05 22:03
ralphNOSPAM@primemail.com wrote:
>
> Is there a function or otherwise some way to pull out the target text
> within an XML tag?
There are at least two PHP extensions that allow parsing XML:
http://www.php.net/XML
http://www.php.net/DOMXML
There's also the SimpleXML extension, but it requires PHP 5.
> For example, in the XML tag below, I want to pull out 'CALIFORNIA'.
>
> <txtNameUSState>CALIFORNIA</txtNameUSState>
If this is all you want, you can simply do
$state = strip_tags('<txtNameUSState>CALIFORNIA</txtNameUSState>');
or use regular expressions.
Cheers,
NC
[Back to original message]
|