为什么我的preg_match不敏感?

时间:2015-05-07 16:45:11

标签: php regex preg-match

我的表单允许用户上传文件进行3D打印,但我想将可能的文件限制为.obj或.stl

} elseif (!preg_match("/^.*\.(stl|obj)$/i",$model['name'])) {
//reject because it's not the correct extension.

当扩展名为小写(.stl)时,表单工作正常,但是当它是大写(.STL)时它拒绝它

1 个答案:

答案 0 :(得分:0)

这是一个愚蠢的人类伎俩。它无论如何都无效。 Barmar的评论让我看起来并且看到我的变量名称错了。

相关问题