Javatpoint Logo
Javatpoint Logo

PHP explode() Function

PHP explode() is string function, which is used to split a string by a string. In another words we can say that the It break a string into an array. The "separator" parameter cannot be an empty string.

Syntax:

Parameter Description Required/Optional
Separator to break string required
String the string to split required
Limit Specify the number of array element optional

Example 1

Output:

Array ( [0] => Hello [1] => Google. [2] => It's [3] => a [4] => Browser. )

Example 2

Output:

Array ( [0] => one,two,three ) Array ( [0] => one [1] => two,three )

Next TopicPHP String




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA