php 正则有关问题

WBOY
Release: 2016-06-13 13:37:55
Original
859 people have browsed it

php 正则问题
$url='http://www.scjj.gov.cn:8088/xxcx/jsp/searchAction!getDzjk.action';
用正则,取出
www.scjj.gov.cn:8088。。
怎么写。。

------解决方案--------------------

PHP code
$url='http://www.scjj.gov.cn:8088/xxcx/jsp/searchAction!getDzjk.action';
preg_match_all( "/////(*?)///", $str, $tmp);
var_dump($tmp);
<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
PHP code

preg_match("/\/\/(.*?)\//",$str,$tmp);
var_dump($tmp);
<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
探讨
引用:
PHP code


preg_match("/\/\/(.*?)\//",$str,$tmp);
var_dump($tmp);

(.*?)怎么不会到www.scjj.gov.cn:8088/xxcx和www.scjj.gov.cn:8088/xxcx/jsp这个的?
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!