Friday, April 3, 2015

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

Both are used to split a string to array,
the basic difference is that split() uses pattern for splitting and explode() uses a string.

explode() is faster than split() as it does not match the string based on regular expression. 
 Also split() is deprecated as of 5.3.0. So using of this function is discouraged.

No comments:

Post a Comment