2013-02-01 33 views
0

在我的PHP文件我用下面的返回,我的职位是在类别:我想消除20%在我的回声返回

<?php echo single_cat_title(); ?>

类别标题,然后在我的网址返回。但是,由于我的类别是两个字(“南非”),因此网址为:“south%20africa”而不是“southafrica”。

我知道“%20”正在插入,因为网址不能有中断。有没有办法编辑上述<?php echo single_cat_title(); ?>返回类别标题,但消除任何休息?

+1

见:http://php.net/manual/en/function.urldecode.php - 而且,你想要的 “南非” 而不是 “southafrica” 吧? – ficuscr

回答

2
echo urldecode("south%20africa"); 

echo str_replace('%20', '', "south%20africa"); 
+0

我现在有这个权利:<?php echo single_cat_title(); ?> 我想让它返回“southafrica”而不是“south%20africa” – TheExpeditioner

+1

尝试'str_replace('','',urldecode(single_cat_title()));' –