$str ='本文实例讲述了php匹配字符串里所有URL地址的方法。http://www.manongjc.com 分享给大家供大家参考';
preg_match_all("/http:[\/]{2}[a-z]+[.]{1}[a-z\d\-]+[.]{1}[a-z\d]*[\/]*[A-Za-z\d]*[\/]*[A-Za-z\d]*/",$str,$array2);
print_r($array2);
(
[0] => Array
(
[0] => http://www.manongjc.com
)
)
int preg_match_all ( string pattern, string subject, array matches [, int flags] )
<?php
preg_match_all ("|<[^>]+>(.*)</[^>]+>|U","<b>example: </b><div align=left>this is a test</div>",$out, PREG_PATTERN_ORDER);
/* http://www.manongjc.com/article/1591.html */
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
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有