You are here: Re: StrPos Help « PHP Programming Language « IT news, forums, messages
Re: StrPos Help

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация