小编neu*_*aus的帖子

用于过滤扩展的格式正确的regexp是什么样的?

如何将4个扩展名与regexp匹配?

我累了这个:

$returnValue = preg_match('/(pdf|jpg|jpeg|tif)/', 'pdf', $matches);
Run Code Online (Sandbox Code Playgroud)

我不知道为什么我得到2场比赛?我是regexp中遗漏的东西吗?

array (
  0 => 'pdf',
  1 => 'pdf',
)
Run Code Online (Sandbox Code Playgroud)

php regex

1
推荐指数
1
解决办法
30
查看次数

标签 统计

php ×1

regex ×1