Parsing a CSV String Into an Array in PHP


Convert a CSV string into an array using str_getcsv().

Source Code

$csv = "one,two,three";
$array = str_getcsv($csv);
print_r($array); // Outputs array elements
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments