In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how php converts binary to decimal". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Php converts binary to decimal: 1, use bindec () function, syntax "bindec ($binary_string)"; 2, use base_convert () function, syntax "base_convert ($binary_string,2,10)".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Php converts binary to decimal
1. Use the bindec () function
The bindec ($binary_string) function converts the binary number $binary_string to a decimal number.
Output result:
2. Use the base_convert () function
The base_convert () function converts numbers between arbitrary digits.
Base_convert ($binary_string,$frombase,$tobase)
$binary_string is required. Specifies the binary number to be converted.
$frombase is required. Specify the original base of the number. Between 2 and 36 (inclusive). Numbers higher than decimal are denoted by the letter amurz, for example, a for 10, b for 11, and z for 35.
$tobase is required. Specify the base to be converted. Between 2 and 36 (inclusive). Numbers higher than decimal are denoted by the letter amurz, for example, a for 10, b for 11, and z for 35.
Output result:
That's all for "how php converts binary to decimal". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 213
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.