Splitting a String into an Array in PHP


Split a string by a delimiter into an array using explode().

Source Code

$string = "one,two,three";
$array = explode(",", $string);
print_r($array); // Outputs the split elements as an array
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments