Non-Regex function to replace <br> with <br />?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Non-Regex function to replace <br> with <br />?
I'm currently looking for a non-regex function in PHP that will replace unclosed <br> elements with properly closed <br /> elements. I'd prefer to do this without using regex if at all possible. 
Re: Non-Regex function to replace <br> with <br />?
What's wrong with str_replace()?
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Non-Regex function to replace <br> with <br />?
I was applying this to the wrong part of my script which is the only reason you beat me to post #2.
Code: Select all
$message_xml = str_replace("<br>", "<br />", $message);