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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

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

Postby swetha » Tue Nov 11, 2008 1:07 am

hi,
can anyone tell me the difference clearly between split() and explode() functions in php?


thanks
swetha
Forum Commoner
 
Posts: 88
Joined: Wed Sep 10, 2008 11:00 pm

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

Postby pcoder » Tue Nov 11, 2008 1:46 am

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
:)
Regards,
Pcoder
User avatar
pcoder
Forum Contributor
 
Posts: 228
Joined: Fri Nov 03, 2006 6:19 am

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

Postby keerthika » Tue Nov 11, 2008 2:32 am

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.
keerthika
Forum Newbie
 
Posts: 10
Joined: Wed Nov 05, 2008 8:07 am


Return to PHP - Code

Who is online

Users browsing this forum: Google [Bot], natdrip, pillar.of.autumn and 1 guest