FORM INPUT ARRAY
<form method="post" action="next.php">
<input type="hidden" name="my_form_data"
value="<?php echo htmlspecialchars(serialize($my_arr)) ?>">
<button name="submit_btn">Submit</button>
</form>
ATAU
<form method="post" action="next.php">
<input type="hidden" name="my_form_data"
value="<?php echo htmlentities(serialize($my_arr));?>">
</form>
FORM MENERIMA ARRAY
<?php
$my_arr = unserialize($_POST["my_form_data"]);
FUNGSI PILIHAN:
function DAY($tgl){
$day=date('D', strtotime($tgl));
if($day=="Sun"){$hari="Minggu";}
else if($day=="Mon"){$hari="Senin";}
else if($day=="Tue"){$hari="Selasa";}
else if($day=="Wed"){$hari="Rabu";}
else if($day=="Thu"){$hari="Kamis";}
else if($day=="Fri"){$hari="Jumat";}
else if($day=="Sat"){$hari="Sabtu";}
return "$hari";
}
function KATD($tgl){
$day=DAY($tgl);
$hari="Weekday";
if($day=="Sun"){$hari="Weekend";}
else if($day=="Mon"){$hari="Weekday";}
else if($day=="Tue"){$hari="Weekday";}
else if($day=="Wed"){$hari="Weekday";}
else if($day=="Thu"){$hari="Weekday";}
else if($day=="Fri"){$hari="Weekend";}
else if($day=="Sat"){$hari="Weekend";}
return "$hari";
}
function terbilang($i){
$huruf = array("", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh", "Delapan", "Sembilan", "Sepuluh", "Sebelas");
if ($i < 12) return " " . $huruf[$i];
elseif ($i < 20) return terbilang($i - 10) . " Belas";
elseif ($i < 100) return terbilang($i / 10) . " Puluh" . terbilang($i % 10);
elseif ($i < 200) return " Seratus" . terbilang($i - 100);
elseif ($i < 1000) return terbilang($i / 100) . " Ratus" . terbilang($i % 100);
elseif ($i < 2000) return " Seribu" . terbilang($i - 1000);
elseif ($i < 1000000) return terbilang($i / 1000) . " Ribu" . terbilang($i % 1000);
elseif ($i < 1000000000) return terbilang($i / 1000000) . " Juta" . terbilang($i % 1000000);
}
function getMaxMin($data){
foreach($data as$vert) {
foreach($vert as $key => $val) {
if(!isset($maxi[$key]) || $val > $maxi[$key]) {$maxi[$key] = $val;}
if(!isset($mini[$key]) || $val < $mini[$key]) {$mini[$key] = $val;}}}
$output['maxv'] = $maxi;
$output['minv'] = $mini;
return $output;//json_encode($output);
}
function getMinMaxHorizontal($data){
cariHorizontal($data);
foreach($data as $hori => $zon) {
$maxi[$hori] = max($zon);
$mini[$hori] = min($zon);
}
$output['maxh'] = $maxi;
$output['minh'] = $mini;
return $output;
}
function swap(&$arr, $a, $b) {
$tmp = $arr[$a];
$arr[$a] = $arr[$b];
$arr[$b] = $tmp;
}
function getData2($conn,$sql){
$rs=$conn->query($sql);
$rs->data_seek(0);
//$arr = $rs->fetch_all(MYSQLI_ASSOC);
while ($row = $rs->fetch_assoc()) {
$arr[] = $row;
}
$rs->free();
return $arr;
}