php read from file float
Hello I have a text file with three 开发者_运维百科lines. every line has a float number. How can I take each value and put in a float variable even if array?
For example text file is like the following
+3.01\n
-0.0012\n
-0.1\n
I want an array [if it possible] which save the values as float not as string.
Thanks
$fileArr = file($fileName);
$fileArr = array_map('floatval', $fileArr);
精彩评论