Tuesday, June 25, 2013

PHP TYPECASTING

TYPECASTING

Change variable type.
<?php
    echo (float) ( (0.1+0.7)); // echoes 0!
    echo (int) ( (0.1+0.7)); // echoes 0.8!
    echo (double) ( (0.1+0.7)); // echoes 0.8!
?>

No comments:

Post a Comment