当前位置:网站首页>Common functions for PHP to process strings

Common functions for PHP to process strings

2022-07-06 07:46:00 Brother Jing

(1)trim() Remove whitespace and other characters on both sides of the string ;

(2)strlen() Gets the length of the string

(3)mb_strlen() Get string length ( Character encoding can be specified , Calculate the length of Chinese string )

(4)substr() Returns part of a string ;

(5)str_replace() Substring replacement

(6)str_repeat () Duplicate a string

(7)is_string() Check if the variable is a string ;

(8)str_shuffle () Randomly scramble a string

(9)sprintf() Returns the string generated from the formatted string ( Usually used to get the data table name after the sub table )

(10)strstr() First occurrence of lookup string

(11)addslashes Use backslashes to reference strings

原网站

版权声明
本文为[Brother Jing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131901165167.html