开发者

joining str_replace with strtolower

Simple one hopefully, is there a way I can use strtolower and str_replace together. At the moment I am changing the value of a variable and declaring it seperately, and thought if i could do this together it would be more efficient?

$afixteam = str_replace开发者_如何学Python(" ","-",$fixData['ateam_name']);
$afixteamlink = strtolower($afixteam);

Thanks.


this should do it. You can run methods within methods as follows, condensing to a single line.

$afixteam = strtolower(str_replace(" ","-",$fixData['ateam_name']));


$afixteam = strtolower(str_replace(" ","-",$fixData['ateam_name']));

How you would with most things.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜