PHP7 DATA TYPES INTEGERS FLOATS STRINGS BOOLEAN LESSON 10

Floats In PHP7

Floats are numbers too but they contain decimal points. They like integers do not get quotes like strings. Here is an example of a float.

<?php $var=2.5; var_dump($var); ?>

This is the result.

float(2.5)

When Would I Use A Float In PHP7?

You would use a float in PHP7 when you are doing math as well. You may have a float returning from a database query and need to do something with it. This will come in handy when you are making calculations for checkout processes.

Only cool people share!

float-is-a-number with a decimal in it in PHP7

PHP7 DATA TYPES INTEGERS FLOATS STRINGS BOOLEAN LESSON 10 was last modified: October 29th, 2021 by Maximus Mccullough
PHP7 DATA TYPES HOW THEY ARE USED

Pages:Previous 1 2 3 4 Next

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.