parsing really long string (of xml format)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bsharp42
Forum Newbie
Posts: 6
Joined: Sun Aug 02, 2009 12:30 am

parsing really long string (of xml format)

Post by bsharp42 »

Hello,

I have this really long XML-format string that I need to parse. I guess the first question I should ask is, is there a way to parse XML so that I can get the "attributes" of the child tag ??

lets say I have

......
<child childID="948390">
blah blah
</child>
.............

Is there a way for me to get the IDs ???

If not, I was thinking of just parsing the string itself.

I tried sscanf( $the_xml_string, "childID=\"%d\"", $ID); but it didn't do anything...
bsharp42
Forum Newbie
Posts: 6
Joined: Sun Aug 02, 2009 12:30 am

Re: parsing really long string (of xml format)

Post by bsharp42 »

Also, I was wondering if there was something similar in PHP that equals

NSScanner : ScanUpTo function of Obj-C

Basically, the above function

"Scans the string until a given string is encountered, accumulating characters into a string that’s returned by reference."
Post Reply