1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 5.00 out of 5)

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.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

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.

Subscribe To My YouTube Channel:

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

PHP7 DATA TYPES INTEGERS FLOATS STRINGS BOOLEAN LESSON 10 was last modified: March 9th, 2019 by Maximus Mccullough

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share:
PHP7 DATA TYPES HOW THEY ARE USED

Pages:Previous 1 2 3 4 Next

Leave a Reply

Your email address will not be published. Required fields are marked *

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