2013-02-01 27 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()));' –