Tuesday, July 14, 2015

difference between split and explode in php with example

Split() function splits the string into an array using a regular expression and result will be an array.
Explode() function splits the string by string  and result will be an array.


O/P will be
Array ( [0] => India [1] => USA [2] => UK )
Array ( [0] => India [1] => USA [2] => UK )