Page 1 of 1

ex.อธิบายฟังชั่นก์

Posted: 22/08/2014 2:37 pm
by offing
convert function การแปลงเลขฐาน

ิdecbin() = 10to2
decoct() = 10to8
dechex() = 10to16
hexdec() = 16to10

Code: Select all

<?php
$dec = 204;
$hex = "FE";
echo "กำหนดให้ d = 204";
echo "<br>";
echo "d to b = ";
echo decbin($dec);
echo "<br>";
echo "d to h = ";
echo dechex($dec);
echo "<br>";
echo "d to o = ";
echo decoct($dec);
echo "<hr>";
echo "กำหนดให้ h = FE";
echo "<br>";
echo "h to d = ";
echo hexdec($hex);


?>
ผลลัพธ์
1.jpg
1.jpg (14.13 KiB) Viewed 300 times