Re: Parsing XML Tags Help
- From: "NC" <nc@xxxxxxxxx>
- Date: 9 Oct 2005 12:03:56 -0700
ralphNOSPAM@xxxxxxxxxxxxx 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
.
- Follow-Ups:
- Re: Parsing XML Tags Help
- From: ralphNOSPAM
- Re: Parsing XML Tags Help
- References:
- Parsing XML Tags Help
- From: ralphNOSPAM
- Parsing XML Tags Help
- Prev by Date: Parsing XML Tags Help
- Next by Date: Re: Domain Redirect - loses session variables
- Previous by thread: Parsing XML Tags Help
- Next by thread: Re: Parsing XML Tags Help
- Index(es):