Why does bool data appear when directly using the var_dump() function to output data forced by settype()?
城南花已开
城南花已开 2018-12-04 16:00:33
0
2
1413

<?php

$a=100.84;

settype($a,'int');

var_dump($a);

//This will display int (100)

?>

<?php

$a=100.84;

var_dump(settype ($a,'int'));

//This will display bool(true)

?>


城南花已开
城南花已开

reply all(1)
小明

settype has a return value, and if the set type conversion is successful, it returns true. Otherwise, it returns false

  • reply Yes, I found out that because of the settype function structure bool settype (mixed var, string type), it will only return the *** value.
    城南花已开 author 2018-12-05 19:58:05
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template