First, paste the php code and look at the two functions: & amp; lt ;? Php $ email = 'phpddt1990 @ 163.com '; $ arr = split (' \. | @ ', $ email); print_r ($ ar
First, paste the php code and look at the two functions:
At least we can see from the above:
The explode function can only be separated by characters. However, the split function uses regular expressions. of course, the split function can be used to handle some complex string analysis problems. Explode requires certain rules, but the execution efficiency is higher!
It is worth noting that the first piece of code has a small problem: the following error will be reported:
Deprecated: Function split () is deprecated in F: \ web \ zend \ exercise \ test. php on line4
This is because the split () function after php5.3 is not recommended,
POSIX style cannot be used, and the recommended Function (PCRE) is as follows:
* 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