PHP preg_match和preg_match_all函数 [英] PHP preg_match and preg_match_all functions

查看:135
本文介绍了PHP preg_match和preg_match_all函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道preg_matchpreg_match_all函数的作用以及如何使用它们.

I would like to know what the preg_match and preg_match_all functions do and how to use them.

推荐答案

preg_match停止寻找第一个匹配项.另一方面,preg_match_all继续查找,直到完成对整个字符串的处理为止.找到匹配项后,它将使用字符串的其余部分尝试应用其他匹配项.

preg_match stops looking after the first match. preg_match_all, on the other hand, continues to look until it finishes processing the entire string. Once match is found, it uses the remainder of the string to try and apply another match.

http://php.net/manual/en/function. preg-match-all.php

这篇关于PHP preg_match和preg_match_all函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆