1 <? PHP
2
3 Nl2br (); // \ N to <br/>
4 Addslashes (); Stripslashes (); // Escape special characters during database operations
5
6 Chop (); // Removes spaces on the right of the string.
7 Trim (); // Removes all spaces in the string.
8 Ltrim (); // Removes spaces on the left of the string.
9
10 Htmlspecialchars (); // Convert '$', '"', '<', '>' to the corresponding HTML object.
11 Htmlentities (); // Convert all HTML tags to corresponding HTML entities
12
13 Array Explode ( String Separator , String Str ); // Split string
14 String Implode ( String Separator , Array ARR ); // Connection string
15
16 Strtoupper (); Strtolower (); // Case sensitivity
17 Ucfirst (); // Only converts the first character to uppercase.
18 Ucwords (); // Converts the first letter of each word to uppercase.
19 ?>
Replace spaces with regular expressions.CodeYes \ s.
1 <? PHP
2
3 $ String = " Ooo I am a space " ;
4 $ String = Preg_replace ( " /(\ S + )/ " , '' , $ String ); // Replace all spaces
5 Echo $ String ;
6
7 ?>