About PHP functions

Source: Internet
Author: User

From here I began to talk about some PHP-related things, because the video tutorial did not mention too much js,jq,xml and Ajax, these in the follow-up after self-study to write some;

About PHP Basic syntax data types do not introduce, in the PHP manual or the major learning sites have, can be self-access, this chapter mainly about PHP some of the functions of some details;

The difference between require and require_once, when using require to introduce a function, whether or not the introduction of the same function file is still introduced, and require_once before the introduction of the function file to determine whether the same function file was introduced before, If introduced, no longer introduced, now commonly used is require_once, one can save resources, and secondly, can avoid duplicate definitions of errors;

The difference between include and Includ_once is the same as above;

The difference between include and require, when using include to introduce a file error will continue to execute the following code, and require error will terminate execution, include_once and require_once the same;

Whenever PHP encounters an execution function, it opens up a new stack in memory, and the variables between the stacks are independent of each other.

  

This code, the final output is 2 2 3, when the ABC function is called to open a new stack; n=4, satisfies the condition n>2, executes--n (n=3 in this stack), and is opened by ABC function call new stack, n=3, satisfies the condition n>2, executes--n (n=2 in this stack) , also by the ABC function call to open up a new stack, n=2, do not meet n>2, so did not execute--n, directly execute the Echo $n (here n=2), after the execution of the return to the upper level, continue to execute the Echo $n (here n=2), perform the return to the upper level, continue to perform the Echo $n (n =3); In fact, it can be understood that the code is executed from the top down, because this ehco is not within the judgment statement, so whether or not the IF statement will be executed, just because in the IF statement is called the function, so when the upper layer of code execution after the execution of the following Echo statement I don't know if it would be difficult to understand that, these are the things I have summed up through learning, and the teacher may have some different, if there are mistakes hope the big boys pointed out.

There is a small detail here, and every time a function is called, the space occupied by the function in the stack area is cleared;

If we do not want to use a variable in the function, we can use unset (variable name); completely delete a variable;

PHP default is the value, if it is necessary to address, using the "& + variable name";

About PHP functions

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.