Posted by Aerik on 08/07/07 03:37
On Aug 6, 8:44 am, php.developer2...@gmail.com wrote:
> Hi i want to parse a xml document which contains attribute can anybody
> help me in that.
>
> Example
> --------------------
> <category id="1" parent-id="1" level="2">
> <category id="2" parent-id="1" level="3">
> <category id="3" parent-id="5" level="6">
>
> I want to get all id's in this example with using regular
> expressions..
>
> Output
> ----------
> 1
> 2
> 3
Use this regex:
/<category\sid="([0-9]+)"[^>]+/
Aerik
[Back to original message]
|