Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;“埃雷吉”;在php5.6中工作,但是;预赛;替换在PHP7.2中不起作用_Php_Preg Match_Eregi - Fatal编程技术网

&引用;“埃雷吉”;在php5.6中工作,但是;预赛;替换在PHP7.2中不起作用

&引用;“埃雷吉”;在php5.6中工作,但是;预赛;替换在PHP7.2中不起作用,php,preg-match,eregi,Php,Preg Match,Eregi,“Eregi”在php5.6中适用于此照片库模块: 但是,php7.2中的preg_match不适用于同一个Gallery模块。我目前在下面的页面链接中将eregi更改为preg_match,但没有从分配给Gallery的文件夹中提取图像,也没有显示错误: 我在view.php文件中将eregi更改为preg_match // Read the picture directory: while (($filename = readdir($d)) !== false) { if (

“Eregi”在php5.6中适用于此照片库模块:

但是,php7.2中的preg_match不适用于同一个Gallery模块。我目前在下面的页面链接中将eregi更改为preg_match,但没有从分配给Gallery的文件夹中提取图像,也没有显示错误:

我在view.php文件中将eregi更改为preg_match

// Read the picture directory:

while (($filename = readdir($d)) !== false) {

    if ($filename == $thumbdir || ($filename == '..' && $dirname == '') || ($filename != '..' && substr($filename, 0, 1) == '.')) {

        continue;

    }

    $file = $realdir . $delim . $filename;

    if (is_dir($file)) {

        $dirs[] = $filename;

    } elseif (preg_match($query, $file)) { 

        $pics[] = $filename;

    }

}
我希望将eregi更改为preg_match可以解决问题并将照片放入图库。但是,它不起作用,并且该网站的所有图库现在都没有显示。任何帮助都将不胜感激

如果有助于快速解决此问题,我很乐意提供整个模块。

尝试
preg_-match('/'.$query'/',$file)
$query
中有什么内容?Try
preg_-match('/'.$query'/',$file)可能重复。
$query
中有什么内容?可能重复