Home > Backend Development > PHP Tutorial > Regular expression testing tool php URL verification regular expression

Regular expression testing tool php URL verification regular expression

WBOY
Release: 2016-07-29 08:46:13
Original
1185 people have browsed it

Copy the code The code is as follows:


$url = 'http://www.baidu.com/zongzi/oo.html';
$n = preg_match_all("/http:[ /]{2}[a-z]+[.]{1}[a-zd-]+[.]{1}[a-zd]*[/]*[A-Za-zd]*[/]* [A-Za-zd]*[.]*html/",$url,$array);
var_dump($array);
?>

The above introduces the regular expression testing tool PHP URL verification regular expression, including the content of the regular expression testing tool. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template