Home / PHP Tips Generated By ChatGPT / 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