validate (balance) html tags

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
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

validate (balance) html tags

Post by amir »

Looking for a solution to validate a string to make sure all html tags are balanced.
if a tag is opened and not closed (or vice versa) it is considered unbalanced and that tag should be removed (or turned into a comment

Code: Select all

<!-- B -->
)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

Thanks! I 'll certainly have a look and let you know.
Post Reply