Copy codeThe Code is as follows:// PHP automatically obtains the corresponding constellation function based on the ID card numberFunction get_xingzuo ($ cid) {// automatically returns the corresponding Constellation Based on the ID card numberIf (!
Sometimes the following warning occurs when writing a php program:
PHP Warning: date (): It is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function.
The switch label in the ThinkPHP template is used to output different values in the template according to different situations.
The ThinkPHP template engine supports switch judgment and outputs different results based on different conditions. The
The short URL algorithm implemented by php theoretically supports 1,073,741,824 short URLs.
Each URL is replaced by 6 characters, and (6 ^ 32) can have up to 1,073,741,824 short URLs.Of course, you can also record more detailed information, such as
Abs: obtain the absolute value. Acos: returns the arc cosine. Ada_afetch: gets the back column of the database. Ada_autocommit: Enables or disables automatic changes. Ada_close: disable Adaba
Abs: obtain the absolute value.
Acos: returns the arc
If var is a non-null or non-zero value, empty () returns FALSE. In other words, 0, 0, NULL, FALSE, array (), var $ var; and objects without any attribute will be considered empty. If var is empty, returns TRUE.
What is the difference between empty
The escape () function can encode a string so that the string can be read on all computers. Syntax: escape (string) parameter: string required. description: the string to be escaped or encoded.
The escape () function can encode a string so that the
In a 32-bit system, ip2long cannot be converted to IPv6, but you can convert ip2bin and bin2ip. This function is converted to IPv4 and IPv6, and false is returned. if it is invalid, the instance program: & lt ;? Phpfunctionip
In a 32-bit system,
PHP removes trim () from the beginning and end of a string. the instance code is as follows: & lt ;? Php $ a & quot; (a, B, c,) & quot; echo $ a & quot; & lt; br & gt; & quot; output: (, b, c,) $ btrim ($ a, & quot; () & quot;); removes the first
Delete textarea carriage return and line feed code: functionremoveNL (s) {NewLine, CarriageReturnandTabcharactersfromaStringwillberemovedandwillreturnthen
Delete textarea carriage return and line feed code:
Function removeNL (s)
{
//
In php, the session times out in 30 minutes by default, but sometimes it automatically times out in less than 30 minutes. this is inconvenient for many operations. let's take a look at the solution to the 30-minute timeout.
In php, the session times
Session_start (): enable the session mechanism. call session_register (): register the session variable session_unregister () at the beginning of the program file that requires the session ():
Session_start (): Enables the session mechanism and
This article describes a new function of php5. we will introduce the usage and some problems of PHP magic function _ autoload, the following summarizes some problems and precautions during usage.
This article describes a new function of php5. we
Let's take a look at the analysis of abstract classes and abstract methods in php. I hope this article will be helpful to you. In the object-oriented (OOP) language
Let's take a look at the analysis of abstract classes and abstract methods in php. I
This article mainly describes how to use the $ this, static, final, const, and self keywords in the php class. $ This indicates that the current instance is accessed through internal methods of the class.
This article mainly describes how to use the
We usually use array () to define data in php. if you do not know the length of the array, you can define the length of the unknown data as array, if you want to clear the data, you can directly unset (array [key]) or directly reset the value to
The following example program is a PHP regular expression program that matches UTF8 or gbk Chinese correctly. it can accurately identify Chinese characters in different encoding conditions. The PHP example code is as follows: $ action
The following
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