If the value of variable i is 6, when converted by floatval(), it should be 6.0 instead of 6, right? - PHP Chinese Questions and Answers - If the value of variable i is 6, when converted by floatval(), it should be 6.0 instead of 6, right? 6? - PHP Chinese website Q&A
If the value of variable i is 6, when converted by floatval(), it should be 6.0 instead of 6, right? - PHP Chinese Questions and Answers - If the value of variable i is 6, when converted by floatval(), it should be 6.0 instead of 6, right? 6? - PHP Chinese website Q&A
Take a look around and learn.
不是的,建议看下php手册
floatval是返回变量里面包含的浮点数
会输出float(6.0342),只是返回了这个变量从左到右的浮点数部分
会输出float(0),因为第一个是字母q,他默认没有找到浮点数