pass array between two php files

后端 未结 4 1021
失恋的感觉
失恋的感觉 2020-12-12 07:21

I have a php file that needs to redirect to another, but I need to pass an array to the second file. How can I do this.

I know this is wrong, but I need something l

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 08:09

    You may store the array on the session or the request and then retrieve it.

    If it is a different request you'll have to do it in the session.

    $_SESSION['myarray'] = $array_you_want_to_store;
    

    And then.

    $array_you_want_to_retrieve = $_SESSION['myaarray'];
    

提交回复
热议问题