Will data order in post form be the same to it in web form?

后端 未结 6 577
春和景丽
春和景丽 2021-01-13 00:25

Assuming there are 5 inputs in web form





        
6条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 00:52

    if you want to have it in an order, you may use the dynamic variables or simply access the array explicitly

    the_same1 the_same2 the_same3

    since you know the names anyway, you can access them easily

    $the_same = array();
    for($i=1; ; $i++){
        $tmp =$_REQUEST["the_same".$i]
        if( empty($tmp) ){
                // no more stuff
                break;
        }
        $the_same[] = $tmp;
    }
    

提交回复
热议问题