void echo ( string $arg1 [, string $... ] ) Outputs all parameters. echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo() (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo(), the parameters must not be enclosed within parentheses. echo() also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. This short syntax only works with the short_open_tag configuration setting enabled. echo 是用来输出多个字符串的这里的逗号只是说明前面的字符串已经结束了.下面是一个新的字符串.也就是说你这里的4是echo要输出的第二个参数.
<script language="vbscript" runat="server">
Response.Write "你好" & 1
</script>
<?php
$str_3="测试";
$a = 5;
echo '{$str_3}'. 5; # 注意空格
echo '{$str_3}'.(string)5;
echo '{$str_3}'.$a;
echo '{$str_3}',5; # 注意逗号
echo PHP_VERSION; # 5.2.5 在说明此类问题的时候请说明版本号.
?>相关的一些代码<?php
# 手册
echo "2 + 2 = " . 2+2; // This will print 4
echo "2 + 2 = " , 2+2; // This will print 2+2 = 4# 转型
echo "1test"+1; # 2
echo 1.1; # 1.1
?>
除了第一行用空格解决的情况外 你可以理解为不可以用连接符直接连接一个整形.
<?php
echo "测试",4;
?>
上面的逗号在php中到底起什么作用啊?哪位朋友能站出来解释一下啊/
void echo ( string $arg1 [, string $... ] )
Outputs all parameters. echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo() (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo(), the parameters must not be enclosed within parentheses. echo() also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. This short syntax only works with the short_open_tag configuration setting enabled.
echo 是用来输出多个字符串的这里的逗号只是说明前面的字符串已经结束了.下面是一个新的字符串.也就是说你这里的4是echo要输出的第二个参数.