当前位置:网站首页>PHP match regular fetch URL
PHP match regular fetch URL
2022-07-21 05:41:00 【Ango can't move】
Remove all url And don't repeat
function getJustAllUrl($inUrlText)
{
$parttern = "/http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[[email protected]&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+/";
preg_match_all($parttern, $inUrlText, $match);
return count($match) > 0 ? array_unique($match[0]) : '';
}
Take out only url
function getJustUrl($inUrlText)
{
$parttern = "/http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[[email protected]&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+/";
preg_match($parttern, $inUrlText, $match);
return count($match) > 0 ? $match[0] : '';
}
边栏推荐
- tp5.0 后台admin访问
- R package simputation for interpolating missing values in R language
- R language | vectorization operation purrr package
- Iptables firewall experiment
- 利用yaml定义卷积网络【附代码】
- R 语言 rmd输出有中文 ,怎么去除中文
- 「接口测试入门课」打卡学习 day09:微服务接口:怎么用Mock解决混乱的调用关系
- R language optimization problem
- php 匹配正则 取出url
- Rmarkdown与Word文档的交互
猜你喜欢
R 语言 rmd输出有中文 ,怎么去除中文
开源轻量级工作流WorkflowCore介绍
Spark efficient data analysis 04. RRD creation
多线程理论基础
Scala变量和数据类型(01)
数字孪生虚拟现实的发展趋势
「接口测试入门课」打卡学习 day06:接口测试平台:工具和框架不可以兼容?
ByteDance (Tiktok) software test monthly salary 23K post, technical director three interview questions are newly released
Drawing multi group Y-axis truncation graph with R language
Spss-kmeans聚类实操
随机推荐
Aruba learning notes 02 Web UI -- Introduction to dashborder panel
ASP. Net core using redis
Niuke net question brushing training (II)
「接口测试入门课」打卡学习 day08:测试数据,是不是可以把所有的参数都保存到Excel中?
试着换个角度理解低代码平台设计的本质
R language world values survey assignment
Girls who have just started the software testing industry can get a monthly salary of more than 10000 to solve the mystery of the fraud
「接口测试入门课」打卡学习 day09:微服务接口:怎么用Mock解决混乱的调用关系
什么是栈?
R语言 | jiebaR 词频统计
阿里云 cdn 域名的配置方法
Regular expression matching URL
经典网络学习-ResNet代码实现
Spark高效数据分析04、RRD创建
ASP. Net core usage record 3
R language | jiebar word frequency statistics
Two common ways of communication between VLANs
R语言求 凹凸区间及拐点
R 语言 rmd输出有中文 ,怎么去除中文
「接口测试入门课」打卡学习 day07:WebSocket接口:如何测试一个完全陌生的协议接口?