FavoriteLoading
0

php字符串连接符

说明:通过(.)或(.=)进行字符串的拼接

 //字符串连接符
$name = 'admin';
echo '您好!'.$name.'重蔚自留地';
echo '您好!.$name重蔚自留地';
echo '
';
//.=:链接后再赋值
$user = 'admin';
$user .= '888'; //相当于:$user = 'admin' . '888';
echo $user;
echo '
';
//随机数--给4个随机数
$num = rand(0,9);
$num .= rand(0,9);
$num .= rand(0,9);
$num .= rand(0,9);
echo $num;
?>
欢迎分享本文,转载请保留出处!—重蔚自留地 站长邮箱:951076433@qq.com