PHP strip_tags only at the end of the string
- by Solomon Closson
Ok, well, I just want to use strip_tags function on the very end of a string to get rid of any <br /> tags.
Here's what I have now, but this is no good because it strips these tags from everywhere in the string, which is not what I want. I only need them stripped out if it's at the end of the string...
$string = strip_tags($string, strtr($string, array('<br />' => ' ')));
How can I do this same thing, except only at the very end of a string??
Thanks guys!!