Converting a String to an Array in PHP


Use explode() to split a string into an array based on a delimiter.

Source Code

$text = "one,two,three";
$parts = explode(",", $text);
print_r($parts);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments