Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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(" ","-",$fixData['ateam_name']);
$afixteamlink = strtolower($afixteam);

Thanks.

like image 976
Richard Avatar asked Jan 26 '26 22:01

Richard


1 Answers

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

$afixteam = strtolower(str_replace(" ","-",$fixData['ateam_name']));
like image 194
Mild Fuzz Avatar answered Jan 29 '26 11:01

Mild Fuzz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!