PHP floatval()、doubleval () 函数
PHP 教程
· 2019-01-31 14:44:48
floatval 函数用于获取变量的浮点值。
floatval 不能用于数组或对象。
版本要求:PHP 4 >= 4.2.0, PHP 5, PHP 7。
doubleval 是 floatval 的别名。
语法
float floatval ( mixed $var )
参数说明:
- $var:要转换的变量,不是是数组或对象。
返回值
变量 var 的 float 数值。
实例
实例
$var = '122.34343codercto';
$float_value_of_var = floatval ($var);
echo $float_value_of_var;
执行结果如下所示:
122.34343
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
The Algorithm Design Manual
Steven S Skiena / Springer / 2011-11-14 / GBP 55.07
....The most comprehensive guide to designing practical and efficient algorithms.... Written by a well-known algorithms researcher who received the IEEE Computer Science and Engineering Teaching Aw......一起来看看 《The Algorithm Design Manual》 这本书的介绍吧!