: This article mainly introduces the use of strings in PHP programs. For more information about PHP tutorials, see. 1. string declaration
(1) single quotation marks and double quotation marks can be used.
Difference: variables can be parsed in double quotes and all escape characters can be used.
(2) use delimiters <
2. String Processing
It mainly uses strings for segmentation, matching, search, and replacement.
3. string processing functions
Features:
1. for other types of data, you can also use string processing functions. the processing process is to convert other types of data into strings and then process them.
2. a string can access each character like an array through subscript, but the type is not an array, it is a string
3. besides English and Chinese characters (UTF8 occupies 3 bytes for different encodings)
(1) strlen ("hello"); count the length of the string
(2) $ str [0]. $ str [1]; the first and second elements of the access string $ str. the type is a string. (You can also use {} to access subscript)
The above describes the use of strings in the PHP program, including the content, and hope to be helpful to friends who are interested in the PHP Tutorial.