Home > Backend Development > PHP Tutorial > Detailed explanation of php5 and mysql5 web development technology-2 String operation_PHP tutorial

Detailed explanation of php5 and mysql5 web development technology-2 String operation_PHP tutorial

WBOY
Release: 2016-07-14 10:08:57
Original
905 people have browsed it

String learning mainly involves mastering built-in functions.

There are too many functions, and I haven’t remembered many yet. I will simply record the functions first and add them later.
1. Definition method: single quote, double quote, or {}
{} is convenient for displaying index arrays, and double quotes parse variables
2. Manually convert string data
symbol to implement
The addslashes() and addcslashes() functions can be used to customize the transfer
3. Serialization and deserialization serialize(), unserialize()
4. String sorting
trim(), ltrim(), rtrim()
Remove spaces, newline characters (n, r), horizontal and vertical tab characters (t, v) and string terminators (
5. Format string
nl2br()
wordwrap()
strtolower()
strtoupper()
ucfirst()
ucwords()
6. Split
explode() and join() with the same name
Example: explode("@",$email) ;
7. String interception
substr(‘target string’, starting point, end point)
8. strlen() / mb_strlen()
9. str_word_count()
Combined with array_count_values() to count the number of word occurrences
10. Search www.2cto.com
strstr($string,"keyword") ,stristr() ,strrch()
strpos()
str_repeat()
substr_count()
11. Processing
str_replace()
substr_replace()
strrev()
htmlspecialchars(), htmlentitles() Convert special characters such as <,>,&, " into html entities
strip_tags() clear html tags
strncmp(),strcmp()
Strok() parses string
strpbrk()
strspn(),strcspn()
str_replace()

http://www.bkjia.com/PHPjc/477718.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477718.htmlTechArticleString learning is mainly about mastering built-in functions. There are too many functions, and I haven’t memorized many yet. I will simply record the functions first and add them later. 1. Definition method: single quote, double quote...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template