|
Posted by ralphNOSPAM on 10/10/05 07:57
On 9 Oct 2005 12:03:56 -0700, "NC" <nc@iname.com> wrote:
>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
There are multiple tags I need to strip out of the xml image so your
$state = example wouldn't work. Sorry, I was trying not to get too
deep.
I did read the php xml extension before I posted but I got lost.
I was hoping there was a function that would pull out the text between
an xml tag. If there is such a function in the php xml extensions I
couldn't see it ir otherwise figure it out.
[Back to original message]
|