php curly braces groups

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-22T02:37:51Z Indexed on 2010/04/22 2:43 UTC
Read the original article Hit count: 428

Filed under:
|

is there a function or regex or anything to group items by a { and } tag? so it should group items by the opening tag { and the closing tag }. but be careful, there are also groups inside parent groups like so:

group {
   text1
   group2 { 
      text2
   }
}

so basically think of it like php, you make an opening tag, you need to close it with a closing tag, curly braces in php's case.

i just need it to like substr() each group into an associative array somehow, except I cant figure it out with the whole, "group inside a parent group".

© Stack Overflow or respective owner

Related posts about php

Related posts about group