Basic Syntax-PHP manual notes

Source: Internet
Author: User
PHP tags

If the file content is pure PHP code, it is best to remove the PHP end tag at the end of the file. This avoids having to accidentally add a space or line break after the PHP end tag, which causes PHP to start outputting these blanks, and there is no intention to output the script at this time. Of course PHP starts tagging 前的空格或者换行符依然会输出。

使用条件的高级分离术

下面这段代码的意思很容易理解,关键是if-else的用法,这样使用在文本输出是显的逻辑更加清晰。

  This will show if the expression is true. Otherwise this will show. 

指令分隔符

PHP需要在每个语句后用分号结束指令,这个分号就叫指令分隔符。在一个PHP代码段中的最后一行可以不用分号结束。

注释

PHP支持C,C++和Unix Shell风格(Perl 风格)的注释,也就是/**///#

单行注释仅仅注释到行末或者当前的PHP代码块,这意味着在// ... ?>或者# ... ?>之后的HTML代码将被显示出来。不过,标记在单行注释中不会跳出PHP模式。

(全文完)

以上就介绍了基本语法 - PHP手册笔记,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.