问如何将 关联数组 里面的值提出 来存到一个新的数组中?
在学习从数据库中提出数据显示直方图的过程中,
我参看了jpgraph-1.21b,中的例子。
核心问题是:如何将 数据存放在数组$datay 里面!附:
<?php
// $Id: balloonex1.php,v 1.5 2002/12/15 16:08:51 aditus Exp $
include ("../jpgraph.php");
include ("../jpgraph_scatter.php");// Some data
$datax = array(1,2,3,4,5,6,7,8);//月份
$datay = array(12,23,95,18,65,28,86,44);//在线时间,关键所在
// Callback for ers
// Must return array(width,color,fill_color)
// If any of the returned values are "" then the
// default value for that parameter will be used.
function FCallback($aVal) {
    // This callback will adjust the fill color and size of
    // the datapoint according to the data value according to
    if( $aVal < 30 ) $c = "blue";
    elseif( $aVal < 70 ) $c = "green";
    else $c="red";
    return array(floor($aVal/3),"",$c);
}// Setup a basic graph
$graph = new Graph(400,300,'auto');
$graph->SetScale("linlin");
$graph->img->SetMargin(40,100,40,40);                
$graph->SetShadow();
$graph->title->Set("Example of ballon scatter plot");
// Use a lot of grace to get large scales
$graph->yaxis->scale->SetGrace(50,10);// Make sure X-axis as at the bottom of the graph
$graph->xaxis->SetPos('min');// Create the scatter plot
$sp1 = new ScatterPlot($datay,$datax);
$sp1->->SetType(MARK_FILLEDCIRCLE);// Uncomment the following two lines to display the values
$sp1->value->Show();
$sp1->value->SetFont(FF_FONT1,FS_BOLD);// Specify the callback
$sp1->->SetCallback("FCallback");// Setup the legend for plot
$sp1->SetLegend('Year 2002');// Add the scatter plot to the graph
$graph->Add($sp1);// ... and send to browser
$graph->Stroke();?>请大家帮帮我想想