PHP 输出一个数组中一个数值连续出现的次数(或者只输出连续出现的最大...答:numberArray = array(0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1);$str = implode('', $numberArray);$Tokens = explode('1', $str);$maxCount = 0;foreach ($Tokens as $oneToken) { if ($oneToken == '') continu...