Home > DeveloperSection > Interviews > What is the difference between explode and split?

Posted on    June-13-2011 6:01 AM

 1 Answer(s)
  2494  View(s)
Rate this:

Awadhendra Tiwari

Total Post:510

Posted on    June-13-2011 12:00 AM

Split function splits string into array by regular expression. Explode splits a string into array by string.

For Example:

explode(" and", "India and Pakistan and Srilanka");

split(" :", "India : Pakistan : Srilanka");

Both of these functions will return an array that contains India, Pakistan, and Srilanka.

Don't want to miss updates? Please click the below button!

Follow MindStick