[Solved] Pipe Delimited List with numbers into array PHP


Here’s how I went about it for anyone else wondering

$SurveyOptions = preg_match_all('/(\d+)-([^|]+)/', 
$res['survey_response_digit_map'], $matches);
$finalArray = array_combine($matches[1], $matches[2]);

Pretty straight forward.

solved Pipe Delimited List with numbers into array PHP