Why is turning on magic_quotes_gpc in PHP considered a bad practice?
See Question&Answers more detail:osWhy is turning on magic_quotes_gpc in PHP considered a bad practice?
See Question&Answers more detail:osI don't think I can explain it any better than the makers of PHP itself (with followup comments on that page): Why not to use Magic Quotes
get_magic_quotes_gpc()
to check for this, and code accordingly.addslashes()
) at runtime is more efficient. Although php.ini-development enables these directives by default, php.ini-production disables it. This recommendation is mainly due to performance reasons.stripslashes()
.Note - This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.