Home »

What is the difference between explode and split?

Question ListCategory: PHPWhat is the difference between explode and split?
jully882 author asked 8 years ago
1 Answers
ethanbrown author answered 8 years ago

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.

Please login or Register to Submit Answer