How PHP or mysql traverses

this is the foreground display page, and the business logic goes like this:

(Input)
6

from=018

18:
111222.....

clipboard.png

Mar.11,2021

there is no high-end way to judge whether it is empty or not. It is simple and rude


Let's see if this is all right.
represents the value of input as an array, and then all the input received by the background are in one array

$hotels = array();
$arr = $_POST['arr'];

foreach ($arr as $k => $v) {
    if($k%3 == 0){
        if($v){
            if(!$arr[$k+1] || !$arr[$k+2]){
                echo json_encode(array(
                    "code" => -1,
                    "msg"  => "",
                ));
                die;
            }
            $hotels[] = array(
                "name" => $v,
                "cost" => $arr[$k+1],
                "time" => $arr[$k+2],
            );
        }else{
            $hotels[] = array(0, 0, 0);
        }
    }
}
echo json_encode(array(
    "code" => 0,
    "msg"  => "success",
));
The parameters in the

form can be written as an array: < input type= "text" name= "time []" / >, you can learn about this

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3cfa0-2c340.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3cfa0-2c340.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?