Home  >  Article  >  Backend Development  >  What is a floating point type in PHP data type? How to use PHP floats?

What is a floating point type in PHP data type? How to use PHP floats?

慕斯
慕斯Original
2021-05-21 13:43:433084browse

What is the PHP data type floating point? As "newbies", let's continue to explore the mysteries of PHP together! ! ! I believe this article can bring you a better understanding of PHP! ! ! Let's Go!!!

What is a floating point type in PHP data type? How to use PHP floats?

##There are two main ways to declare:

1: Scientific statement

2: Ordinary statement

For the ordinary statement, the code is as follows:

<?php
//声明浮点型变量$fl
$fl=1432.23424;
echo $fl;
?>

The running result is as follows:

What is a floating point type in PHP data type? How to use PHP floats?

echo is an output function, and although var_dump() is also a function, if you insert a variable into (), this function will print the data type, and The length and value of the variable will also be displayed accordingly.

So we use var_dump to write a PHP code as follows:

<?php
//声明浮点型变量$fl
$fl=1432.23424;
var_dump($fl);
?>

The running result is as follows:

What is a floating point type in PHP data type? How to use PHP floats?

Recommendation: "

php video tutorial"

The above is the detailed content of What is a floating point type in PHP data type? How to use PHP floats?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn