0

重複の可能性:
関数 eregi() は非推奨です

こんにちは、このエラーが発生しています

非推奨: 関数 eregi() は、4 行目の /home/u578804202/public_html/includes/functions.php で非推奨です

これが私のコードです:

if(eregi($file,$_SERVER['REQUEST_URI'])) {
    die("Sorry but you cannot access this file directly for security reasons.");
}
4

2 に答える 2

0

preg_match代わりに使用する必要があります:

if (!preg_match("~{$file}~i,", $_SERVER['REQUEST_URI'])) {
    die("Sorry but you cannot access this file directly for security reasons.");
}
于 2013-01-26T02:26:02.230 に答える
0

当然のことながら、これは非推奨の古い関数であり、stristr()代わりに user

if(stristr($_SERVER['REQUEST_URI'],$file)) {
    die("Sorry but you cannot access this file directly for security reasons.");
}
于 2013-01-26T02:17:32.397 に答える