pass array between two php files

后端 未结 4 1027
失恋的感觉
失恋的感觉 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:08

    If you don't want to expose your $array, you MUST use PHP inbuild session support.

    session_start(); // DO CALL ON TOP OF BOTH PAGES
    $_SESSION['array'] = $array;
    echo $_SESSION['array']; // GIVES SAME $array FOR BOTH PAGES
    

提交回复
热议问题