Wednesday, February 12, 2014

What is the difference between split() and explode()?

Split() function has been deprecated because:-
  • explode() is substantially faster because it doesn't split based on a regular expression, so the string doesn't have to be analyzed by the regex parser. Simply it splits string.
  • preg_split() is faster and uses PCRE regular expressions for regex splits
  • join() and implode() are aliases of each other and therefore don't have any differences.

No comments:

Post a Comment