Here is one way of doing it
$str="2,100|7,104|15,1110";
$arr1 = explode("|",$str);
if(sizeof($arr1) > 0 ){
$final_array = array() ;
foreach($arr1 as $data){
$arr2 = explode(",",$data);
$final_array[$arr2[0]] = $arr2[1];
}
}
print_r($final_array);
solved convert the string to an array