php ข้อความเพื่อน int ได้
intval($string);
แสดงข้อความต้อง php น int ได้
$num = "3.14";
$int = (int)$num;//string to int
$float = (float)$num;//string to float
php เพื่อน int ได้
$num = "3.14";
$int = (int)$num;
แปลงเป็นข้อความต้อง php น int ได้
s = "123";
echo intval(s); // 123
s = "hello";
echo intval(s); //0
แปลงเป็นข้อความไปที่เบอร์อยู่ใน PHP
phpCopy<?php
$variable = "abc";
$integer = (int)$variable;
echo "The variable has converted to a number and its value is $integer.";
?>
ข้อความต้อง php น int ได้
$str = "10";
$num = (int)$str;
php ลอยเพื่อน int ได้
$int = intval($float);