There are many character string operations in PHP3.0, including the following:(1) echo, print, printf, sprintfUsed to output the string. If there is a variable name in the string, it will be replaced with its value. The last two functions are
At one level, the explode and split functions in php are used to split characters into arrays. However, there are still differences between explode and split, next I will introduce it to you.
First, let's take a look at the definitions of the two
First, we will introduce some simple but essential and practical knowledge. It can be used as a manual query and is suitable for beginners like me.
Common PHP library functions
I. Common functions for PHP string operations1. Determine the string
(1) echo, print, printf, sprintf The first two functions are output strings. If there is a variable name in the string, it is replaced with its value. The last two functions are similar to C functions with the same name. (2) strchr, strlen,
Note the use of escape characters \, \ ", \ $Use octal or hexadecimal characters to represent \ xf6Echo "H \ xf6me"; // check whether such text encoding is supported--------------------- Output result ----------------------------------------H e------
Ec (2); phpexplode instance and tutorial arrayexplode (stringseparator, stringstring [, intlimit]) separator required. Specifies where to split the string. String is required. The string to be split. Limit is optional. Specifies the maximum number
PHP can divide the string into an array, and also can be connected to the string, and the exact connection of the array elements into a string, with these two functions we can be between the array and the string of free conversion, see the example
a function of judging typeIs_bool () //Determines whether the Boolean is_float () //Determines whether it is a floating-point is_real () ///Is_int ()/ /To determine whether the integer Is_integer () // Ibid. is_string ()
// Convert the binary representation of a number into hexadecimal formatString bin2hex (string tring)// Remove spaces at the end of the stringString rtrim (string)// Rtrim aliasString chop (string)// Remove spaces from both ends of the stringString
This article describes how to obtain the absolute address of a Youku video. For more information, see
This article describes how to obtain the absolute address of a Youku video. For more information, see
Some time ago, a series of video site
Array explode (string $ separator, string $ string [, int $ limit])
This function has three parameters. The first parameter $ separator sets a delimiter (string ). The second parameter $ string specifies the string to be operated. The $ limit
StringNote the difference between single quotes and double quotesNote the use of escape characters \, \ ", \ $Use octal or hexadecimal characters to represent \ xf6Echo "H \ xf6me"; // check whether such text encoding is supported--------------------
Copy codeThe Code is as follows:$ A = "string ";$ C = explode ("text to be deleted", $ a, 2 );$ B = $ c [0]. $ c [1];Explode(PHP 3, PHP 4, PHP 5)Explode -- use one string to separate another stringDescriptionArray explode (string separator, string [,
Speaking of php, the function is very long and important, and it is also a php enthusiast, and friends who prefer php advanced must control the stuff, learning php friends also know that the array is also necessary to grasp, in that way, advanced
This article mainly introduces the usage of the prototype Framework's $ symbol, and analyzes the usage tips and precautions of the $ symbol in detail based on the instance form, for more information about the prototype framework, see the example
Function One:count_chars- returns information about the characters used in the stringEach string byte value in the statistic (0: 255) The number of occurrences, using multiple modes to return results. The optional parameter mode default value is
1 string splitting--split () function and Preg_split () function
split-using Regular Expressions to split strings into arrays--seemingly PHP5.3 above deprecatedArray split (string $pattern, string $string [, int $limit])
Preg_split-separating
Note the differences between single and double quotation marks for strings. Note the use of escape characters \, \, \ $. Note that the use of octal or hexadecimal characters represents \ xf6echoH \ xf6me; // check whether such text encoding is
This article mainly introduces some string operation functions in PHP that can replace regular expression functions. This article summarizes some special string operation functions. For more information, see
0x01: perform lexical analysis on strings
Let's talk about the use of explode and implode in php, ballet shoes, and hope to help friends and friends! Speaking of php, the function is very long and important, and it is also a php enthusiast, and friends who prefer php Advanced must control
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.