รวมฟังก์ชันแปลงเลขฐาน
function : bindec ( string );
return type : int
content : ใช้แปลงเลขฐาน 2 เป็นเลขฐาน 10
example : echo bindec ( "11111111" );
comment : bin ย่อมาจาก binary , dec ย่อมาจาก decimal
function : decbin ( number );
return type : string
content : ใช้แปลงเลขฐาน 10 เป็นเลขฐาน 2
example : echo decbin ( 128 );
comment : dec ย่อมาจาก decimal , bin ย่อมาจาก binary
function : octdec ( string );
return type : int
content : ใช้แปลงเลขฐาน 8 เป็นเลขฐาน 10
example : echo octdec ( "100" );
comment : oct ย่อมาจาก octal , dec ย่อมาจาก decimal
function : decoct ( number );
return type : string
content : ใช้แปลงเลขฐาน 10 เป็นเลขฐาน 8
example : echo decoct ( 16 );
comment : dec ย่อมาจาก decimal ,oct ย่อมาจาก octal
function : hexdec ( string );
return type : int
content : ใช้แปลงเลขฐาน 16 เป็นเลขฐาน 10
example : echo hexdec ( "abc" );
comment : hex ย่อมาจาก hexadecimal ,dec ย่อมาจาก decimal
function : dechex ( number );
return type : string
content : ใช้แปลงเลขฐาน 10 เป็นเลขฐาน 16
example : echo dechex ( 200 );
comment : dec ย่อมาจาก decimal ,hex ย่อมาจาก hexadecimal
function : base_convert ( string, frombase, tobase );
return type : string
content : ใช้แปลงเลขฐาน จากฐานที่กำหนด เป็นเลขฐานที่กำหนด
example : echo base_convert ( "11111111", 2, 10 );
PHP:Convert Function รวมฟังก์ชันแปลงเลขฐาน
Moderator: mindphp, ผู้ดูแลกระดาน
-
- PHP Full Member
- โพสต์: 44
- ลงทะเบียนเมื่อ: 08/08/2018 9:49 am
-
- Similar Topics
- ตอบกลับ
- แสดง
- โพสต์ล่าสุด
-
-
โพสต์ใหม่ การใช้งาน python ในการสร้าง function ซ้อน function ที่เอาไว้ใช้สำหรับใช้งานภายใน function เท่านั้น
โดย ewqolf » 02/03/2023 9:26 pm » ใน Python Knowledge - 0 ตอบกลับ
- 2814 แสดง
-
โพสต์ล่าสุด โดย ewqolf
02/03/2023 9:26 pm
-
-
-
โพสต์ใหม่ สอบถาม เรื่อง function phpBB ครับ function make_forum_select() คืออะไรครับ ทำงานอย่างไร
โดย flook » 09/08/2022 5:27 pm » ใน Programming - PHP - 2 ตอบกลับ
- 865 แสดง
-
โพสต์ล่าสุด โดย mindphp
05/09/2022 10:03 am
-
-
- 0 ตอบกลับ
- 2738 แสดง
-
โพสต์ล่าสุด โดย ธวัชชัย แสนหาญ
04/01/2019 10:15 am
-
-
โพสต์ใหม่ Call to undefined function เรียก function ไฟล์อื่นเข้ามาใช้งาน phpbb3.1
โดย thatsawan » 28/09/2014 9:56 pm » ใน Programming - PHP - 0 ตอบกลับ
- 1774 แสดง
-
โพสต์ล่าสุด โดย thatsawan
28/09/2014 9:56 pm
-
-
-
โพสต์ใหม่ convert List<string> to 1,2,3,4,5
โดย jataz2 » 25/08/2015 3:55 pm » ใน Programming - C/C++ & java & Python - 0 ตอบกลับ
- 955 แสดง
-
โพสต์ล่าสุด โดย jataz2
25/08/2015 3:55 pm
-
ผู้ใช้งานขณะนี้
สมาชิกกำลังดูบอร์ดนี้: facebook.com [Crawler] และบุคลทั่วไป 73