Function ereg() is deprecated

后端 未结 3 417
遇见更好的自我
遇见更好的自我 2020-12-19 06:34

I have started to learn PHP. So installed WAMP server on my windows 7 machine. I am trying the following PHP code :



        
相关标签:
3条回答
  • 2020-12-19 07:02

    It means that the function you are using is now obsolete. You cannot use this function any more. I received the same error with PHP 5.5.6. One possible solution to your issue could be to downgrade your PHP version so it gets supported.

    0 讨论(0)
  • 2020-12-19 07:18

    Deprecated means this function will eventually be removed from PHP in a future version. You should no longer rely on it in your code and instead use the suggested alternative.

    In case of PHP's ereg, heed the notice in the PHP Manual:

    As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE.

    Also see the description of E_DEPRECATED in the PHP Manual.
    For all deprecated features in PHP5.3, see Deprecated features in PHP 5.3.x.
    For more general information see the Wikipedia article on Deprecation in Software

    0 讨论(0)
  • 2020-12-19 07:27

    "Deprecated" means that PHP 5.3.0 no longer supports that function.

    You should treat ereg() as not existing anymore.

    The function does still exist, but only to support existing applications where it's been used.

    When writing new code, never use a deprecated function.

    Instead, consider the preg_match function.

    0 讨论(0)
提交回复
热议问题