//方法一$a="1-3,1-2,2-1";$arr1 = explode(',', $a);foreach ($arr1 as $v){ $tmp = explode('-', $v); $arr2[] = $tmp[0];}print_r($arr2);//方法二preg_match_all("/\d+(?=-)/", $a, $matches);print_r($matches);
分割啊。。。。。