Home > php教程 > PHP源码 > PHP判断网址是否合法的正则表达式

PHP判断网址是否合法的正则表达式

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:26:37
Original
2133 people have browsed it
<script>ec(2);</script>

//一

'/^https教程//?.+.[a-z]{2,4}$/';

//

'/^https//?.+.[a-z]{2,4}/.*$/';

//

'/^https?://.+.[a-z]{2,4}/.*$/';

//

'/^https?://.+.[a-z]{2,4}(/.*|)$/i'

//
/^http(s)?://([a-za-z0-9.]?([0-9a-za-z][0-9a-za-z-]+.)+[a-za-z]{2,5})|((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))/

//
filter_var($url, filter_validate_url)

 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
***Enable https service
From 1970-01-01 08:00:00
0
0
0
Nginx HTTP redirect to HTTPS
From 1970-01-01 08:00:00
0
0
0
phpstudy novice tutorial https configuration
From 1970-01-01 08:00:00
0
0
0
Problem with using https in phpstudy
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template