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.
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.
Please like, share and subscribe.
I hope you enjoyed the article. If I was able to help you please consider a tip for the content.
One Time Tip