PHP以逗号为分割点,计算数组有长度 $str='张三,李四,王五 ,赵六'; $arr=explode(',',$str); $total_element=count($arr); //total_element就是数组元素的个数;