Foreach value from POST from form

前端 未结 4 1227
野性不改
野性不改 2020-12-01 23:32

I post some data over to another page from a form. It\'s a shopping cart, and the form that\'s being submitted is being generated on the page before depending on how many it

4条回答
  •  北海茫月
    2020-12-02 00:12

    If your post keys have to be parsed and the keys are sequences with data, you can try this:

    Post data example: Storeitem|14=data14

    foreach($_POST as $key => $value){
        $key=Filterdata($key); $value=Filterdata($value);
        echo($key."=".$value."
    "); }

    then you can use strpos to isolate the end of the key separating the number from the key.

提交回复
热议问题