您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 定西分类信息网,免费分类信息发布

函式:preg_match_all()_PHP

2024/6/1 14:31:45发布26次查看
函式:preg_match_all()
--------------------------------------------------------------------------------
perl 相容语法函式库
preg_match_all
字串整体比对剖析。
语法: int preg_match_all(string pattern, string subject, array matches, int [order]);
传回值: 整数
函式种类: 资料处理
内容说明
本函式以 pattern 的规则来整体剖析比对字串 subject。比对结果传回的值放在阵列参数 matches 之中,并依顺序值 order 排序。参数 order 的值有 preg_pattern_order 及 preg_set_order 二种。若没有 order 值,则系统自动以 preg_pattern_order 代入 order 值中。传回值为合乎比对结果的数目,若没有或错误则传回 false 值。
使用范例
preg_pattern_order 的例子
(.*)[^>]+>|u, a test
, $out, preg_pattern_order);
print $out[0][0]., .$out[0][1].\n;
print $out[1][0]., .$out[1][1].\n
?>
传回值为
b>example: /b>, div align=left>this is a test/div>
example: , this is a test
preg_set_order 的例子
(.*)[^>]+>|u, a test
, $out, preg_set_order);
print $out[0][0]., .$out[0][1].\n;
print $out[1][0]., .$out[1][1].\n
?>
传回值为
b>example: /b>, example:
div align=left>this is a test/div>, this is a test
定西分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录