Home > Backend Development > PHP Tutorial > Can sprintf convert hexadecimal to decimal?

Can sprintf convert hexadecimal to decimal?

WBOY
Release: 2016-08-23 09:17:53
Original
2789 people have browsed it

echo sprintf("%x","10");
a
Complete the conversion from decimal to hexadecimal;

Can sprintf convert hexadecimal to decimal?
Don’t want to use base_convert function.
echo base_convert('a',16,10);
10

Reply content:

echo sprintf("%x","10");
a
Complete the conversion from decimal to hexadecimal;

Can sprintf convert hexadecimal to decimal?
Don’t want to use base_convert function.
echo base_convert('a',16,10);
10

<code>echo sprintf("%d", 0x00FF);</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template