WHAT IS THE DIFFERENCE BETWEEN EXPLODE AND SPLIT?

Awadhendra Tiwari

Total Post:505

Points:2525
Posted by  Awadhendra Tiwari
PHP 
PHP
 2983  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:505

    Points:2525
    What is the difference between explode and split?

    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.

      Modified On Mar-27-2018 12:55:21 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!