php - How to delete quotes from a string -
how can delete quotes string?
i trying create password recovery site, , example if quote, variable use in query (to avoid sql injections) , want use same variable mail($to,...,...,...) obtain 'example@gmail.com' , quotes email useless mail() function.
how can delete quotes string without compromising security?
thanks in advice , have day.
p.s new php.
to remove character string can use str-replace function. doc : http://php.net/manual/en/function.str-replace.php
exemple:
$stringwithquote = "foo'bar"; $stringwithoutquote = str_replace("'", "", $stringwithquote); but avoid sql injection, should use pdo in php code: http://php.net/manual/en/book.pdo.php
Comments
Post a Comment