Php 转换为小写并连接

Php 转换为小写并连接,php,concatenation,lowercase,Php,Concatenation,Lowercase,什么是最好的转换为小写和连接 $first = "Abc Def"; $second= "Ghi Jkl"; $result= $first.$second; 预期输出:abcdef.ghijklstrtolower转换为小写 $first = str_replace(' ','',strtolower("Abc Def")); $second= str_replace(' ','',strtolower("Ghi Jkl")); $result= $first.$secon

什么是最好的转换为小写和连接

$first      = "Abc Def";
$second= "Ghi Jkl";
$result= $first.$second;    

预期输出:
abcdef.ghijkl
strtolower
转换为小写

$first = str_replace(' ','',strtolower("Abc Def"));
$second= str_replace(' ','',strtolower("Ghi Jkl"));
$result= $first.$second;    

使用
strtolower
转换小写,使用
str\u replace
删除空格。 最后,将两个变量连接起来,并在它们之间添加一个
$first      = "Abc Def";
$second= "Ghi Jkl";

$low_first = strtolower(str_replace(" ","",$first));
$low_second = strtolower(str_replace(" ","",$second));
echo $finalresult = $low_first.'.'.$low_second;
输出

abcdef.ghijkl

希望这个最简单的也能有所帮助。这里我们使用多个函数
内爆
str\u替换
strtolower


strtolower(str_replace(“,”,$result))
在预期答案中没有空格,它们之间也有
。对不起,兄弟,@SahilGulati没有看到,谢谢兄弟
$first      = "Abc Def";
$second= "Ghi Jkl";

$low_first = strtolower(str_replace(" ","",$first));
$low_second = strtolower(str_replace(" ","",$second));
echo $finalresult = $low_first.'.'.$low_second;