php正则表达

WBOY
Release: 2016-06-13 13:43:56
Original
988 people have browsed it

求一个php正则表达
字符串如下。
hphm=AB198B*hpzl=01*fdjh=6111*

我想获得=和*之间值。。(即AB198B,01和6111)。

求preg_match_all的写法。

最好说明一下,谢谢。

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

PHP code

$html="hphm=AB198B*hpzl=01*fdjh=6128*";
preg_match_all('/=([^*]*)\*/U',$html,$arr);
print_r($arr[1]);
<br><font color="#e78608">------解决方案--------------------</font><br>哪里不明白?
<br><font color="#e78608">------解决方案--------------------</font><br>[]里面表示非*  外面的*表示匹配0次或多次。  <br> <div class="clear">
                 
              
              
        
            </div>
Copy after login
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!