我有一个具有这种结构的变量:
$catname = 'this-is-my-category';
如何删除“ - ”并获取:
$catname = 'this is my category';
答案 0 :(得分:5)
答案 1 :(得分:1)
$catname = str_replace('-', ' ', $catname);
答案 2 :(得分:1)
答案 3 :(得分:0)
$catname = str_replace("-", " ", $catname);