PHP explode() Function Example Tutorial
This article will provide example of php explode function. I’m going to show you about php explode string to array. it's simple example of php split string to array using explode. This article will give you simple example of explode function in php example.
The PHP explode() function breaks a string into an array. explode() takes a three argument separator, string and limit. limit is a optional.
Let's see below syntax and example:
$myString = "Hi, I am ItSolutionStuff.com";
$array = explode(' ', $myString);
 => Hi,
 => I
 => am
 => ItSolutionStuff.com
$myString = "Rajkot,Surat,Bhavnagar,Baroda";
$array = explode(',', $myString, 3);
 => Rajkot
 => Surat
 => Bhavnagar
I hope it can help you...
We are Recommending you
- PHP Explode Every Character into Array Example
- PHP Remove Element from Array by Value Example
- How to Remove Last Element from Array in PHP?
- PHP Multidimensional Array Search By Value Example
- How to remove undefined value from jquery array?
- How to get maximum key value of array in PHP?
- How to remove empty values from array in PHP?
- How to add prefix in each key of PHP Array?
- How to get minimum key value of array in PHP?
- How to remove null values from array in PHP?