In order to draw my chart, I need to have 2 arrays of floats,
- The first one stores in MySQL database as a type of string (separated by commas)
- And I want to define the second one as a constant array (in PHP)
my problem is how to change the type of data as string(MySQL) and use it as arrays of float in PHP. Also, how should I define the second array? Should I change it to string and then use unserialize?
This just print 1
$data = array();
$data['cols'] = array(
array('id' => 'Signal','label' => 'Signal', 'type' => 'string'));
$rows = array();
while($r = mysql_fetch_assoc($result)) {
$temp = array();
$temp[] = array('v' => $r['Signal']);
$res = array_map("floatval", $temp);
var_dump($res);}
echo var_dump($res);