温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php语法参考-基本语法指令分隔符和注释

发布时间:2020-06-14 20:03:13 来源:网络 阅读:454 作者:芭菲雨 栏目:web开发

指令分割方式与C或者perl类似---每个语句有分号隔开。

结束标记(?>)同样隐含语句的结束,因此下面的代码是等价的

<?php

echo "This is a text";

?>

<?php echo "This is a test"?>

注释:

php支持'c',c++和unix shell风格的注释;例如:

<?php

echo "This is a test";//This is a one-line c++ style comment

/*This is a multi line comment

yet another line of comment*/

echo "This is yet another test";

echo "One Final Test";#This is shell-style style comment

?>

"单行"注释仅仅注释到行末或者当前的代码块,视乎哪个首先出现。

<h2>This is an <?php # echo "simple"?>example.</h2>

<p>The header above will say 'This is an example'.

小心不要嵌套'C'风格的注释,当注释大量的代码时,可能犯该错误。

<?php

/*

echo "This is a test";/*This comment will cause a problem*/

*/

?>

单行注释仅仅注释到行末或者当前的php代码块


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI