Home >Backend Development >PHP Tutorial >The difference between PHP function eregi() and ereg() in practical applications_PHP tutorial

The difference between PHP function eregi() and ereg() in practical applications_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:30:161152browse

  • How to apply function eregi(). In fact, the usage of the PHP function eregi() is basically the same as ereg(). What we are going to talk about today is the difference between it and the ereg() function.

    The following is an example to illustrate the difference between the PHP functions eregi() and ereg():

    Look for the capital letter C in abcdef

    <ol class="dp-xml"><li class="alt"><span><span class="tag"><</SPAN><SPAN> ?php  </SPAN></SPAN><LI><SPAN>if (ereg("C","abcdef")){  </SPAN><LI class=alt><SPAN>     echo "通过";  </SPAN><LI><SPAN>}else{  </SPAN><LI class=alt><SPAN>     echo "错误";  </SPAN><LI><SPAN>}  </SPAN><LI class=alt><SPAN class=tag>?></span><span> </span></span></li></ol>

    //Return The result is: Error

    <ol class="dp-xml"><li class="alt"><span><span class="tag"><</SPAN><SPAN> ?php  </SPAN></SPAN><LI><SPAN>if (eregi("C","abcdef")){  </SPAN><LI class=alt><SPAN>     echo "通过";  </SPAN><LI><SPAN>}else{  </SPAN><LI class=alt><SPAN>     echo "错误";  </SPAN><LI><SPAN>}  </SPAN><LI class=alt><SPAN class=tag>?></span><span> </span></span></li></ol>

    //The return result is:

    ereg() is case-sensitive, and the PHP function eregi() is case-independent.


    www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446313.htmlTechArticleHow to apply function eregi(). In fact, the usage of the PHP function eregi() is basically the same as ereg(). What we are going to talk about today is the difference between it and the ereg() function. The following is an example of this PHP function...
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