Numbers
The (int), (integer), or intval() function are often used to convert a value to an integer.<?php
// Cast float to int
$x = 23465.768;
$int_cast = (int)$x;
echo $int_cast;
echo "<br>";
// Cast string to int
$x = "23465.768";
$int_cast = (int)$x;
echo $int_cast;
?>結果:
23465
23465
頁:
[1]