如何替换PHP中已弃用的set_magic_quotes_runtime? [英] How can I replace the deprecated set_magic_quotes_runtime in php?

查看:78
本文介绍了如何替换PHP中已弃用的set_magic_quotes_runtime?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行必须使用但未编写的php脚本时,我收到此消息.

I'm getting this message when I try to run a php script I have to use but did not write.

Deprecated: Function set_magic_quotes_runtime() is deprecated in /opt/lampp/htdocs/webEchange/SiteWeb_V5/inc/fpdf.php on line 1810

这是第1810行:

set_magic_quotes_runtime(0);

如果此功能已被弃用,我可以用什么代替它?

If this is a deprecated function, what can I replace it with?

非常感谢您!

推荐答案

检查是否在第一个.那应该摆脱警告,并且可以确保如果您的代码在旧版本的PHP上运行,则魔术引号确实关闭了.

Check if it's on first. That should get rid of the warning and it'll ensure that if your code is run on older versions of PHP that magic quotes are indeed off.

不要仅仅按照他人的建议删除该行代码,除非您可以100%确保该代码永远不会在PHP 5.3之前的任何版本上运行.

Don't just remove that line of code as suggested by others unless you can be 100% sure that the code will never be run on anything before PHP 5.3.

<?php
// Check if magic_quotes_runtime is active
if(get_magic_quotes_runtime())
{
    // Deactivate
    set_magic_quotes_runtime(false);
}
?>

在PHP 5.3中不推荐使用

get_magic_quotes_runtime.
来源: http://us2.php.net/get_magic_quotes_runtime/

get_magic_quotes_runtime is NOT deprecated in PHP 5.3.
Source: http://us2.php.net/get_magic_quotes_runtime/

这篇关于如何替换PHP中已弃用的set_magic_quotes_runtime?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆