&引用;“埃雷吉”;在php5.6中工作,但是;预赛;替换在PHP7.2中不起作用
“Eregi”在php5.6中适用于此照片库模块: 但是,php7.2中的preg_match不适用于同一个Gallery模块。我目前在下面的页面链接中将eregi更改为preg_match,但没有从分配给Gallery的文件夹中提取图像,也没有显示错误: 我在view.php文件中将eregi更改为preg_match&引用;“埃雷吉”;在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 (
// 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
中有什么内容?Trypreg_-match('/'.$query'/',$file)可能重复。
在$query
中有什么内容?可能重复