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!
I have a string that has <br /> 's in it. I want to remove these and replace with just a space. However when I try to use preg_replace it changes them all to <> instead of just a space. Here is the code I'm using.
Regular expressions must be surrounded by a delimiter. The most common delimiter is '/', but in your case you have a '/' inside the RE, so another character would be better; I often use '#':
SmokyBarnable wrote:I have a string that has <br /> 's in it. I want to remove these and replace with just a space. However when I try to use preg_replace it changes them all to <> instead of just a space. Here is the code I'm using.