开发者

ASP Replace in PHP?

Hi I want to do a simple replace using str_replace, lik开发者_JAVA百科e Classic ASP.

$strName="Blush / Black";
$strName=$strName(str_replace("/","&"));

It should read, when echo:

Blush & Black. I get an Fatal error: Call to undefined function


$strName="Blush / Black";
$strName=str_replace("/","&", $strName);


$strName=$strName(str_replace("/","&"));
         ^---- error

you're using a "variable function". In this case, telling PHP to execute a function called Bush / Black, which is not a valid function name, and also doesn't exist.

What you want is:

   $strName = str_replace('/', '&', 'Blush / Black');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜