PHP review and consolidation notes

Source: Internet
Author: User
: This article mainly introduces PHP review and consolidation notes. if you are interested in PHP tutorials, please refer to them. I am busy writing reports, meetings, progress, and basic coding on weekdays.

The Spring Festival holiday is approaching. Let's take a look at PHP. Complete the study notes for your reference.

1. usage of or in the basic tutorial


or在这里是这样理解的,因为在PHP中并不区分数据类型,所以$myfile既可以是int也可以bool,所以这样的语句不会报错。 bool or bool这样的语句中,如果前一个值为真后一个值就不会再判断了。这里也是的,所以如果fopen函数执行正确的话,会返回一个大于0的int值(这其实就是“真”),后面的语句就不会执行了。如果fopen函数执行失败,就会返回false,那么就会判断后面的表达式是否为真了。 结果执行了die()之后,不管返回什么,程序都已经停止执行了,并且显示指定的出错信息,也就达到了调试的目的。

类似的用法比如:

defined('YII_DEBUG') or define('YII_DEBUG',true);

2,

以上就介绍了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.