开发者

joining str_replace with strtolower

开发者 https://www.devze.com 2023-02-28 03:05 出处:网络
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 toge

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

精彩评论

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