Pass array from one page to another

后端 未结 4 1593
时光说笑
时光说笑 2021-01-13 04:55

I have an array containing some values, say

arr[\'one\'] = \"one value here\";
arr[\'two\'] = \"second value here\";
arr[\'three\'] = \"third value here\";
         


        
4条回答
  •  情歌与酒
    2021-01-13 05:34

    If you dont want to use sessions, you can just include the page in the other file.

    file1.php

    
    

    file2.php

    
    

    If the array is dynamically created and you want to pass it through GET or POST you should form the URL on the server side and redirect the user to the HTTP URL page instead of the php file.

    So something like:

    file1.php

    
    

    file2.php

    
    

提交回复
热议问题