I have a multidim array I need to pass from one script to another as part of a function call.
The array size will vary, but has the form:
$chart[0][0] = "";
$chart[0][1] = "100";
$chart[0][2] = "110";
$chart[0][3] = "120";
$chart[0][4] = "130";
$chart[1][0] = "CNC";
$chart[1][1] = 83;
$chart[1][2] = 11;
$chart[1][3] = 3;
$chart[1][4] = 3;
The call to the second script is as follows:
print InsertChart("charts.swf", "charts_library", "sample.php?data=".$chart,650, 400);
The parameters of the above function are as follows:
charts.swf //inserts flash file into web page
charts_library //tells function where to find charts_library
sample.php?data=".$chart //tells it where to get chart parameters and data
650,400 //specifies height and width
//On the called script I try to receive the array as follows:
$tableData = $_REQUEST['chart_data'];
//I then try to assign it to a $chart array in this file
$chart['chart_data'] = $tableData;
//I also tried array_push($chart, $tableData); but got nowhere.
But something isn't working as the data is not added to the chart. If I place the $chart data in the sample.php file everything works great so I know all the other pieces are working. I seem to just be doing something wrong getting $chart['chart_data'] from one script to the other. I don't know if it matters but I also add other dimensions to the $chart array once in the sample.php file such as $chart['chart_type'].