1 min read

PHP type cast float to int

  Description

 int intval ( mixed $var [, int $base = 10 ] )

 Parameters Description

 $var : The value which converted to an integer

 $base : Conversion base

 Examples

 <?phpecho intval(42);           // 42echo intval(4.2);           // 4echo intval('42');          // 42

Share your Love

Leave a Reply

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