How to convert floating point numbers to integers in php when using the module operator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to convert floating point numbers to integers in php when using the module operator

Understanding basic convertion modes in php

28th May 2017, 3:21 PM
Name Space
Name Space - avatar
1 Answer
+ 2
either you can use round up function like ceil() or floor() or simply intval() i.e. $a = 3.43; $convert = intval($a); echo $convert; //output :: 3
28th May 2017, 10:06 PM
101 Zair
101 Zair - avatar