1-6编程练习
来源:1-6 编程练习
神知
2018-11-27 23:42:06
$name = "stefen";
$call = "10795856";
$motto = "If you shed tears when you miss the sun,then you would miss the stars";
$str = $name.$call.$motto;
var_dump(strlen($str));
为什么最后用var_dumo不用echo呢?
2回答
guly
2018-11-28
你好,字符串连接时的空格是连接的字符之间需要空格时。
比如:连接下列字符串为: I LOVE china;
<?php header('content-type:text/html;charset=uft-8'); $name='I'; $call='LOVE'; $motto='china'; $total=$name." ".$call ." ".$motto; echo $total //var_dump(strlen($total));
最后用var_dump和echo都是可以的。
如果解决您的问题请采纳,祝学习愉快!
神知
提问者
2018-11-27
还有个问题,字符串连接时的空格是什么意思?$str = $name.$call.$motto;是在三个之间加空格吗?但是实际并没有增加数字呢?