preg_replace("/|/", "", $title); Code (markup): In case you're wondering what "/|/" is it's the sign on the same key as backslash, except you use the Shift key to use it. It doesn't do it if you just do it as it is in the example. There must be some way of removing it.
Oops. As I posted this I realized that it also means "or" in regex. So escaping it "/\|/" should do it.
uhm... str_replace doesn't use regex. Why don't you just do str_replace('|','',$string); Code (markup): it works perfectly?
Actually, if you look at my edits it will say: preg_replace, I later changed it to str_replace, but forgot to remove the word regex from the post. I am going to change it back to preg_replace to not confuse anyone any further.
Okay, that makes more sense - now my question becomes - why are you using preg_replace() for such a basic change? It's a waste of resources - unless you're not showing the whole code, and just parts of it. There's no point in using preg_replace for such simple removal-scenarios, when you have str_replace available.