Php functions learned today

Source: Internet
Author: User
Tags php session
: This article mainly introduces the php functions learned today. if you are interested in the PHP Tutorial, please refer to them. I have read the TP session implementation and learned the following functions in php!

/*** Mainly used php method * is_array: determines whether it is an array * isset: determines whether the variable is set * --> 1. variable does not exist false * --> 2. the variable exists, but the value is null. false * --> 3. true if the variable exists and the value is not empty * Note:. true * B is returned only when multiple items meet the preceding conditions. after the variable is released by unset, it will no longer be isset * c. this method can only be used for variables and cannot pass any other parameter * difference between this method and empty: empty checks whether a variable is empty * --> 1. returns true if the variable does not exist (different from isset) * --> 2. variable value: ''0'0' null false array () var $ var and object without any attribute true * --> 3. in addition to the preceding two cases, false is returned * Note: only the variable * session_id is used to obtain or set the current session to return the sess. Ion_id () get session_id ('jdjdjjd '); set * session_name: Read or set the session name * session_save_path: Access the current session path * ini_set :( PHP 4, PHP 5, PHP 7) set a value for a configuration option * Note: not all valid options can be changed with ini_set. Here is a list of valid options: http://php.net/manual/zh/ini.list.php * Session_cache_limiter: specifies the buffer control method used by the session page to support the use of * session_cache_expire for back-hop: http://www.php.net/manual/zh/function.session-cache-expire.php * Session_set_save_handler: session_set_save_handler () sets the user-defined session storage function. If you want to use a method other than the built-in session storage mechanism of PHP, * you can use this function. For example, you can customize the session storage function to store session data to the database. * Learning address: http://www.php.net/manual/zh/function.session-set-save-handler.php * Session_regenerate_id: regenerate the session id * session_start: enable session * session_write_close: closing the session can solve the php session blocking problem. article link: http://www.jb51.net/article/48805.htm * Session_unset: releases all the $ _ SESSION variables created in the memory, but does not delete the session file or release the corresponding session * if you only want to release one of the variables, then, use unset ($ _ SESSION ['name']) * session_destroy to delete the session file corresponding to the current user and release the sessionid, the $ _ SESSION variable content in the memory is still reserved * if you want to completely release the session, you need to call session_unset and then call session_destroy * ucwords: convert the first character of each word in the string to uppercase * strpos: locate the first occurrence of a string in another string * strtolower: convert the string to lowercase * is_null: Check whether the variable is NULL * explode: this function cut the string according to the specified string or character separator. Returns the cut string to the array variable * substr: returns a part of the string * Note: garbled characters may occur in the cut Chinese. you can check the mb_substr function to solve this garbled problem ***/

The above describes the php functions learned today, including some content, and hope to help those who are interested in the PHP Tutorial.

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.