我遇到问题我无法修复此错误。我正在使用此上传脚本来检查MIME类型。是什么原因警告:preg_match():未知修饰符'p'
警告:的preg_match():未知的修饰的 'p'
警告:的preg_match():未知的修饰的 'g'
警告:的preg_match():未知的修饰 '('
if (preg_match('/^image/p?jpeg$/i', $_FILES['upload']['type']) or
preg_match('/^image/gif$/i', $_FILES['upload']['type']) or
preg_match('/^image/(x-)?png$/i', $_FILES['upload']['type']))
{
// Handle the file...
}
else
{
$error = 'Please submit a JPEG, GIF, or PNG image file.';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
预先感谢您
如果您使用*/*作为起始分隔符,您必须在正则表达式中转义**/** – donald123