Page 1 of 1

whta is the difference between explode() and split()

Posted: Tue Nov 11, 2008 12:07 am
by swetha
hi,
can anyone tell me the difference clearly between split() and explode() functions in php?


thanks

Re: whta is the difference between explode() and split()

Posted: Tue Nov 11, 2008 12:46 am
by pcoder
Split() splits string into array by regular expression.
It is faster to use explode(), which does not take the overhead of regular expression.
It depends upon your requirement to use these functions.
For more details. Go through it:
http://www.php.net/manual/en/function.split.php
:)

Re: whta is the difference between explode() and split()

Posted: Tue Nov 11, 2008 1:32 am
by keerthika
Both the functions are used to Split a string. However, Split is used to
split a string using a regular expression. On the other hand, Explode is used to
split a string using another string.