Ads

Tuesday, 18 June 2013

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

No comments:

Post a Comment