I'm working on implementing a way to allow HTML in a field that I have with PHP. The characters are saved to the database as they are inputted, so when I print them to the screen later on, I want the HTML to be respected (security is not an issue here, so please don't make it one). What I need right now is a way to change any "
instances to the proper "
character, but only when it falls inside an HTML declaration (i.e., <
and >
characters). When it's not inside these characters, it shouldn't be changed.
What is the proper way to do something like this with regular expression?