you should drop the associative array. You don't need it.
Why did I think I needed it? Oh yeah, because the array might not work if the closing tags were present, just not in the right order. And your recipe fixes that.
What do people think? It's certainly a flawed implementation the way it is now, just giving an overall total, because like I said, 1000 missing open-bold tags and 1000 extra close-font tags comes out to zero, giving a false negative.
First blank: extra closing tags. Probably OK.
Second blank: tags out of order, but all close. Probably OK.
Third blank: tags closed out of order, plus extra closing tags.
extra closing tags. Probably OK.
...unless one of them is
t /table
Yeah this is just a check of formatting tags at the moment. The problem with table tags is you can't just count them, you have to validate a structure: TABLEs containing x number of TRs containing x number of TDs...
I think I might have to go back to that link with the full PHP parser...
I bet that if you put in a close table tag for each open table tag, the board wouldn't be broken and all would be good. The message itself might look like crap, but we're not trying to solve that problem.
John, if you'll send me a copy of the test setup from your server, I'll take a whack at coding it up tonight.
I'm happy to try your solution on my site right now Rob, I'll play with it for a while and see what I come up with.
But now I'm looking for that post which mentioned some full HTML parsing module in PHP and I can't find it.
gaping openmouthed at Things I Don't Understand
cheering
OK, using Rob's model of reversing through the array of open ones and removing all which match a closing one, check out [link] -- and I'm going to lunch! Back in a while...
You are all so goddam cool.