PHP Tutorial > String Functions > addslashes Function. The PHP addslashes function is used to add slashes to certain characters in a string. Those characters are single quote ('), double quote ("), and the NULL character. This function is u
Never use addslashes function to escape values you are going to send to mysql. use mysql_real_escape_string or pg_escape at least if you are not using prepared queries yet. keep in mind that single quote is not the only special character that can break yo
Tip: This function can be used to prepare a string for storage in a database and database queries. Note: Prior to PHP 5.4, the PHP dir magic_quotes_gpc was on by default and it ran addslashes() on all GET, POST, and COOKIE data by default. You should not
Post a Comment:
Showing 0 Comments: