1. String connection
The string is through the half-width period "." , you can concatenate two or more than two strings into a single string.2. Remove string leading and trailing spaces and special characters
The trim () function is provided in PHP
Some common functions in PHP are collected
This article mainly introduces some common functions in PHP collection, this article collects some time date, output printing, commonly used string functions, commonly used array methods, the need for
I didn't see the trim function before. I thought it could only delete the blank space. Today I found that it can also delete ""-null."T"-tab"N"-new line"X0b"-vertical list operator"R"-Press enter""-General white space charactersAnd user-specified
First, SED (stream editor based on line)1.1 Basic usageSED does not edit the source file by default and only handles the data in the pattern spaceSed ' addresscommand ' file ...Address representation Method:1. Start and End linesExample: 1,100
The PHP trim () function is generally used to remove whitespace characters (or other characters) at the beginning and end of a string, and is generally used to process the received user data on the server side, so as not to store the user's input
1.capwords (s) function under the string libraryIt can remove whitespace from both ends, and then use a space instead of a continuous space character.Itemgetter () function under 2.operator module, Itemgetter (item, ...)-Itemgetter objectThe
A line of code in PHP gets the file suffix name
PHP a line of code to get the file suffix name method to combine a lot of functions, we have a bit like the function of ASP, let's take a look at it.
Instance:
The code is as follows
PHP Screen Filter The method of specifying keywords, PHP screen filter keywords
The example in this article describes how PHP masks filter the specified keywords. Share to everyone for your reference. The specific analysis is as
Thinkphp built-in functions detailed description of D, F, S, C, L, A, i,thinkphp functions
Single-letter functions D, F, S, C, L, A, I they are defined in the thinkphp core thinkphp/mode/api/functions.php this file.
Let me explain their functions
The Trim series function is used to remove whitespace or other characters from the end of a string. The LTrim function only removes characters from the string header, and the RTrim function only strips the characters at the end of the string.
Trim
I. BASIC syntax
Start end tag: "
"
Note: the end of the file at the end of the PHP code snippet "?>" can not, in some cases, when using the include () or require () omitted will be better.
Like Java,c, PHP requires a
Use of stringsIn addition to the length property, the string provides the following methods that can be called:var z = "Hello cnblogs"; Defining stringsZ.charat (0); Returns the first character of HZ.charat (z.length-1); Returns the last character
In the current front-end development, front-end separation, modular development, version control, file merging and compression, mock data and so on some of the original back-end ideas began to penetrate into the "big front" development. The
PHP validationThe first step: get the contents of the table only son sent; $_post["]; Use this function to get the form's data,The post must be capitalized, and a single quotation mark must be inside the brackets. The second step: determine whether
Remove whitespace from the string:string str1="abcdefg";S.erase (0, S.find_first_not_of ("")); Str1.erase (S.find_last_not_of ("") + 1); From last, find the first location that is not "". Keep a string from 0 to nRecording:Find_first_not_of
Mathematical functions1.abs (): Absolute value$abs = ABS (-4.2); 4.2 Numeric Absolute number2.ceil (): Into a method to take the wholeecho ceil (9.999); 10 floating point number in one rounding3.floor (): Rounding off the Rounding methodecho Floor (9
2. Boolean valuesTrue or False1 or 03. String type"Hello World"String Common functions:-Remove whitespace-Separate-Length-Index-SlicingClass Str (basestring): "" "" "" Str (object= "), string Return A nice string representation of the object. If
One, String class1. String is a class that is located in the Java.lang package2.2 ways to create a string object:String Variable name = "Value";String Object name =new string ("value");3. Common methods of string3.1 String length--length ()3.2
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.