// let's assume you have the csv data in $csv // you create the new arrays to hold the results $col1 = array(); $col2 = array(); // explode the csv data into an array $csv_exploded = explode("\n", $csv); // loop over the lines from $csv foreach($csv_exploded as $line) { // explode the line into the two part you want $data = explode("/* your seperator here */", $line) // and store them $col1[] = $data[0]; $col2[] = $data[1]; }