Javascript
0.1 + 0.2 Why isn't it equal to 0.3? (correct result: 0.30000000000000004)
0.8 * 7 Why not equal to 5.6? (correct result: 5.6000000000000005)
Php
Var_dump (intval (0.58 * 100));
The correct result is 57, not 58
The curse of floating-point
Instance
Converts the first character of "Hello" to lowercase. :
Definition and usage
The Lcfirst () function converts the first character in a string to lowercase.
Related functions:
Ucfirst ()-Converts the first character in a string to uppercase.
This article through the example code to introduce the PHP form is accustomed to use regular expression, very good, with reference value, need to refer to the friend
Regular expressions are commonly used in PHP forms, as shown in the following code:
Look at the PHP framework today and see the Trait section. Not seen, curiosity checked.
The PHP manual is about solving multiple inheritance problems. But in the general object-oriented language, the solution to multiple inheritance is through the
This article mainly introduces the PHP dictionary tree (trie tree) definition and implementation method, a simple description of the concept of the dictionary tree and the use of examples to analyze the definition of the dictionary tree and usage,
This article mainly introduces the use of Redis to prevent large concurrency under the two write method, combined with an example of PHP using the lock mechanism to achieve concurrent read and write Redis case read and write errors, the need for
For the first time to use the WordPress system friends, please do not worry about publishing articles and other operations, in order to more scientific use and management of WordPress, it should be related to the relevant settings, mainly related to
This article mainly introduced the PHP Redis function usage, combined with the example form summarizes the PHP redis operation commonly used function and the concrete use method, and comes with the PHP connection Redis Singleton class, the need
This article mainly introduces the PHP MySQL PDO query operation examples of relevant information, hope that through this article can help everyone, the need for friends can refer to the next
A detailed example of the PHP MySQL PDO query operation
Preface
This article mainly introduces about PHP to get the first letter of Chinese characters and sorting related content, because often when we do the project, there will be the need for the first alphabetical order, such as: The city of the
"Coercion type conversion"
1, empty conversion to integer is 0;
2, the empty conversion to floating-point type into floating-point type 0;
3, empty conversion to a string into an empty string ", the middle of no characters, including spaces;
4,
Today, I was going to study the implementation of the AR model of yii2.0, however, the plan couldn't keep up with the changes and suddenly wanted to look at the process of yii2.0 database component creation. Through the study of Yii source code, the
The time () function of PHP generates the number of seconds in the current period, but in some cases we need to get the current server time and GMT (GMT) January 1970 0:0 0 seconds in milliseconds, as in Java (Currenttimemilis () function, Think of
Compares the key values of two arrays and returns the difference set:
"Green", "g" = "blue"), $result =array_diff ($a 1, $a 2);p Rint_r ($result);? >
The Array_diff () function is used to compare the key values of two (or more) arrays and return a
This article mainly introduces the PHP multi-process programming of the zombie process of understanding the relevant information, hope that through this article can help everyone, let everyone master this part of the content, the need for friends
Array_change_key_case () converts all the keys of an array to uppercase letters:
' C + + ', ' D ' = ' C # '); Print_r (Array_change_key_case ($input _array, case_lower)); Print_r (Array_change_key_case ($input _array, case_upper)); If
Preface
This article mainly introduces about Laravel request validation writing related content, in the Laravel write API, the current end of the request is Post/put/path and other method, it needs to do request Validation, although for the
Instance
Fills the right side of the string to a new length of 20 characters:
Definition and usage
The Str_pad () function fills the string with a new length.
Grammar
Str_pad (String,length,pad_string,pad_type)
Parameters
Describe
Instance
Replace the character "world" (case-insensitive) in the string "Hello world!" with the words "Peter":
Definition and usage
The Str_ireplace () function replaces some characters in a string (case insensitive).
The function must adhere to
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