php - Need to preg_replace "/|/" -


$title = preg_replace("/|/", "", $title); 

in case you're wondering "/|/" it's sign on same key backslash, except use shift key use it.

it doesn't if in example. there must way of removing it.

i don't know exacly if want remove pipe | or literally /|/ here 2 examples:

$title = "hi | there"; $text = preg_replace("/\|/", "", $title); echo $text; //"hi there";   $title = "hi /|/ there"; $text = preg_replace("/\/\|\//", "", $title); echo $text; //hi there 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -