PHP 中 Python 的“findAll”函数的等价物是什么?

Gal*_*Gal 3 php findall

re.findall(r'(\b[a-zA-Z][a-zA-Z0-9-]*)(?=\.com\b)', DATA)
Run Code Online (Sandbox Code Playgroud)

这行如何在 PHP 中出现?

Jos*_*zel 5

我想你正在寻找preg_match_all.

  • 谁说没有?它仍然通过 $matches 数组引用为您提供匹配项。 (5认同)