Function addslashes_str ($ str ){
$ Str = addslashes ($ str );
$ Str = str_replace ($ str ,";",';');
Return $ str;
}
Function stripslashes_str ($ str ){
$ Str = stripslashes ($ str );
$ Str = str_replace ($ str ,';',";");
Return $ str;
}
?>
Chop (); // remove the right space of the string
Trim (); // remove all spaces in the string
Ltrim (); // remove the left space of the string
Htmlspecialchars (); // converts '$', '"', '<', '>' to the corresponding html Entity
Htmlentities (); // convert all html tags to corresponding html entities
Array explode (string separator, string str); // splits the string
String implode (string separator, array arr); // connection string
Strtoupper (); strtolower (); // converts the case sensitivity
Ucfirst (); // only converts the first character to uppercase.
Ucwords (); // converts the first letter of each word to uppercase.
Iconv ()
Php Internal Code Conversion Function, same as above
Because iconv () is a bug in gb2312 conversion, it should be handled like this
Iconv ("UTF-8", "gb2312 // ignore", $ str)
Mb_convert_encoding ()
Php Internal Code Conversion Function
Version (php 4> = 4.0.6, php 5)
This function can convert various encodings to each other.
Mb_convert_encoding ($ str, "gb2312", "UTF-8 ");
Mysql tutorial _ real_escape_string ()
Definition: special characters in strings used in function escape SQL statements.
Syntax: mysql_real_escape_string (string, connection)
Note: This function escapes special characters in string and considers the current character set to be connected. Therefore, it can be safely used for mysql_query ().
?>