if(preg_match('#(\d+)-(\d+)#', $a, $match)) { var_dump($match[1], $match[2]); //括号表示子分组,用下标1-n读取}更多正则内容请参考我的博客《我眼里的正则表达式入门教程》