Difference between PHP function eregi () and ereg () in actual application _ PHP Tutorial

Source: Internet
Author: User
Tags ereg
The eregi () function of PHP differs from ereg () in actual applications. The application method of the function eregi. In fact, the usage of the PHP function eregi () is basically the same as that of ereg. What we want to talk about today is the difference between it and the ereg () function. The following example illustrates the PHP function.
  • The application method of the function eregi. In fact, the usage of the PHP function eregi () is basically the same as that of ereg. What we want to talk about today is the difference between it and the ereg () function.

    The following example illustrates the differences between the PHP functions eregi () and ereg:

    Check whether the abcdef contains uppercase letters C.

       
       
    1. <? Php
    2. If (ereg ("C", "abcdef ")){
    3. Echo "through ";
    4. } Else {
    5. Echo "error ";
    6. }
    7. ?>

    // The returned result is: Error

       
       
    1. <? Php
    2. If (eregi ("C", "abcdef ")){
    3. Echo "through ";
    4. } Else {
    5. Echo "error ";
    6. }
    7. ?>

    // The returned result is

    Ereg () is case sensitive. the PHP function eregi () is case insensitive.


    Explain () application method. In fact, the usage of the PHP function eregi () is basically the same as that of ereg. What we want to talk about today is the difference between it and the ereg () function. The following example illustrates the PHP function...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.