Deprecated: function eregi_replace () is deprecated split () ereg_replace () ereg () eregi () SQL _regcas

Source: Internet
Author: User
Tags deprecated ereg posix

After PHP is upgraded to 5.3,ProgramThe error "function split () is deprecated" is returned.
This is because of various reasons (mainly for the reason of regular expressions, see below for details). The split function is not supported in the new version.
In PHP, an error is returned when deprecated function is used again. (The deprecated function in Java only provides a warning and can be used again)
Why? Check the first parameter. If the first parameter is not a regular expression, change split to explode. If it is a regular expression, change split to preg_split.
Explode is much faster than before, because regular expressions are used before, while explode does not.
-----
The RegEx after PHP 5.3.0 is expected to use the PCRE specification. POSIX RegEx is not recommended (Unified RegEx to avoid too many specifications ?).
Therefore, the following is a list of functions (PCRE) not recommended for use (POSIX) and recommended for replacement: PHP:

Differences from POSIX RegEx
* POSIX → PCRE
* Ereg_replace () → preg_replace ()
* Ereg () → preg_match ()
* Eregi_replace () → preg_replace ()
* Eregi () → preg_match ()
* Split () → preg_split ()
* Spliti () → preg_split ()
* SQL _regcase () → No equivalent

* Split of RegEx is required, which can be replaced by preg_split ().
* No RegEx is required. You only need to quickly split a fixed string and replace it with explode (). (The speed is much faster than that of RegEx)

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.