How PHP is implemented in the order of 4,5 or
is if there is a bunch of numbers 1,2,3,7,8, how can you put 123 to a group, bar 7, 8 points to another group, that is, the two-way and 7.8 separate
------to solve the idea----------------------
$s = ' 1,2,3,7,8 ';
$ar = Explode (', ', $s);
$arr = Array ();
foreach ($ar as $v) {
$c = count ($arr);
------to solve the idea----------------------
$arr [] = $v;
}else{
$arr [$c -1][] = $v;
}
Print_r ($arr);
Array
(
[0] = = Array
(
[0] = 1
[1] = 2
[2] = 3
)
[1] = = Array
(
[0] = 7
[1] = 8
)
)
------to solve the idea----------------------
$s = ' 1,2,3,7,8 ';
$ar = Explode (', ', $s);
$arr = Array ();
foreach ($ar as $v) {
$c = count ($arr);
------to solve the idea----------------------
$arr [] = $v;
}else{
$arr [$c -1][] = $v;
}
$one = Implode (', ', $arr [0]);
$two = Implode (', ', $arr [1]);
echo "First streak record:" $one;
echo "
";
echo "Second winning streak:". $two;
?>
Operation Result:
First streak: three-to-one
Second winning streak: 7,8