我尝试将一个新数组插入到一个数组中
我尝试使用模块化切割它并将其反转
<?php
literal(12);
function literal($sum){
$n;
for($i=0;$i<$sum;$i++){
$n[] = $i+1;
echo $n[$i];
$length = strlen($n[$i]);//count length reset every loop
$keeper = $n[$i]; //store on new variable reset every loop
for($m=0;$m<$length;$m++){
if($keeper>=10){//just skip if below ten
$newstore[$m] = $keeper%(10^($length-($m+1)));
$keeper = floor($keeper/10);
}else {
$newstore[$m] = $keeper;// this value to keep array and reset it, then keep it again
}
}
$newstored = array_reverse($newstore);//reverse it and reset again
for($a=0;$a<count($newstored);$a++){
$fixed[] = $newstored[$a];
}
}
echo nl2br("\n".count($n)."\n");
for($i=0;$i<count($fixed);$i++){
echo $fixed[$i];
}
echo nl2br("\n".count($fixed));
}
?>
我想要的[1,2,3,4,5,6,7,8,9,1,0,1,1,1,2] 结果是我得到的实际结果[1,2,3,4,5,6,7,8,9,1,1,0,1,1,0,1,1]
谢谢
互换的青春