I am fetching an array of floats from my database but the array I get has converted the values to strings.
How can I convert them into floats again without looping through the array?
Alternatively, how can I fetch the values from the database without converting them to strings?
EDIT:
I am using the Zend Framework and I am using PDO_mysql. The values are stored one per column and that is a requirement so I can't serialize them.
array_map('floatval', $array)
only works on single dimensional arrays.I can't
floatval
the single elements when I use them because I have to pass an array to my flash chart.The momentary, non-generic solution is to extract the rows and do
array_map('floatval',$array)
with each row.