Home  >  Article  >  Backend Development  >  php正则表达

php正则表达

WBOY
WBOYOriginal
2016-06-13 13:43:56989browse

求一个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>
Statement:
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