For once, I have to ask a question. I've been grappling with this for a while now, and I'm going to break down and ask.
Let's say I have a page, with nested if statements. Something like:
if ($one) {
if ($two) {
//Blah
}
else {
//Other blah
}
}
else {
if ($three) {
if ($four) {
}
}
}
To any arbitrary nesting level, is there any way to use a preg_match_all to parse all the first level if's into an array, then the second levels, and so on?
If I didn't make it clear, the code above is not being parsed through PHP, but through a preg_match_all.
I'd think the versatility of RegEx would have something in it's pocket that can take care of this quite handily.
Thanks.