PHP get_magic_quotes_gpc deprecated


Home - Tutorials - Functions

This article explains how to handle get_magic_quotes_gpc deprecated warning in your legacy PHP code.

Tutorial info:


Name:PHP get_magic_quotes_gpc deprecated
Total steps:1
Category:Functions
Level:Beginner

Bookmark PHP get_magic_quotes_gpc deprecated



Step 1 - get_magic_quotes_gpc() deprecated


PHP get_magic_quotes_gpc deprecated

Magic quotes is an old and outdated concept in PHP. It was already deprecated in PHP 5.3 and removed in PHP 5.4. The get_magic_quotes_gpc() function returns the current configuration settings of magic quotes. However, this function has not yet been removed, but has been deprecated in PHP 7.4.

As a lot of old legacy code, like older versions of Wordpress uses get_magic_quotes_gpc and meanwhile PHP is being updated in more and more places, this warning is becoming more common.

Fortunately, fixing it is pretty straightforward, as starting with PHP 5.4, the return value is always 0. You need to remove all of them from your code. No replacement code is needed.

See official docs







Tags: php, php7, get_magic_quotes_gpc, wordpress

PHP get_magic_quotes_gpc deprecated - Table of contents
Step 1 - get_magic_quotes_gpc() deprecated

Follow phpf1 on Twitter




F1 Site Family
AJAX F1
HTML F1
Java F1
JavaScript F1
PHP F1

Total time: 0.1421