Remove URL Forward Slash Before Single or Double quotes in php.ini

To get rid of the forward Slashes (/) included before every single (') or double quote(") in PHP hosting. Edit the php.ini file and add the following line,

magic_quotes_gpc = Off;

If your PHP code works fine on a Windows system does not guarantee that it will also work on Linux or vice-versa. There are loads of issues that may come up when deploying your PHP code on a Linux environment, such as case-sensitivity issues and single quotes, double quotes, slash issues, etc. These issues can be resolved using the PHP configuration file i.e. php.ini file.

About PHP Magic Quotes

PHP magic quotes when ON all the single quotes (') , double quotes ("), backslashes (\), and NULL characters are escaped with a backslash automatically

PHP Magic quotes directives :

magic_quotes_gpc :If ON it affects HTTP GET, POST and COOKIE Request data.

magic_quotes_runtime: Though by default it's OFF but when this directive is ON, most functions that return data from an external source, including databases and text files, will have quotes escaped with a backslash. This can be set at runtime.

magic_quotes_sybase: If this directive is ON, a single-quote is escaped with a single-quote instead of a backslash.

Note: Magic Quotes have been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

Have Questions? Post them here!
Try Out Code2care Dev Tools:


Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
πŸŽ‰ We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR -