Pass PHP processing to another page
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);
?>
精彩评论