开发者

Pass PHP processing to another page

开发者 https://www.devze.com 2023-01-13 01:01 出处:网络
Think of it as a poor开发者_运维百科 mans template system. I want to store my values into a data array and then continue processing the view on another page. What PHP command would I use to accommodat

Think of it as a poor开发者_运维百科 mans template system. I want to store my values into a data array and then continue processing the view on another page. What PHP command would I use to accommodate this?


You can include the second file and the second file will have access to all data.


All you need to do is set your array, and then include the page that will display it. Your included page will have access to the value(s) of $myArray.

Main Page

<?php
    $myArray= Array(1, 2, 3);
    include('ArrayDisplayPage.php');
?>

ArrayDisplayPage.php

<?php
    var_dump($myArray);
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消