Common php knowledge

Source: Internet
Author: User
Common php knowledge 1. session_start (): start a session in PHP. (note that all PHP session information is at the top of the page. Otherwise, an error will occur before any HTML code !)

$ _ SESSION ['...']: SESSION array (enter the variable name or constant name of the object to be referenced or assigned a value in single quotes)

2. setcookie (): used to store session information, session ID

$ _ COOKIE ['...']: COOKIE array

3. session_unset (): variables can be extracted from Sessions.

4. use included files to improve code efficiency (note that any extension can be used for included files, but. php should still be used as the extension, and other extensions are used to protect confidential information or as a reminder)

5. the isset function checks whether a variable is set (it does not check the variable value, but only checks whether a variable is used)

6. print_r (): This function can output variable information.

7. variable name 1as variable name 2: where as serves as variable name 2 as variable name 1

8. File Reference: because the script does not continue to be executed after the file does not exist or is renamed, we recommend that you use require () instead of include ()

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.