Posted by Oli Filth on 10/10/05 19:20
ralphNOSPAM@primemail.com wrote:
> I'm trying to use strpos to find these xml tags so I can pull out the
> text data; but the bracket chars won't let the function work. Is there
> another way to do this?
>
> $php_XML_tag = "<codeFacility>ZNY</codeFacility>";
> $pos = strpos($php_XML_tag, '<codeFacility>');
> print $pos;
>
> results is $pos == 0
Of course it's zero! ;) You're asking it to find the character offset
of "<codeFacility>" within $php_XML_tag, and it's telling you that it's
0, i.e. right at the beginning of the string.
Try looking at regular expressions in the PHP manual, or possibly even
the dedicated XML functions.
--
Oli
[Back to original message]
|