Home > Backend Development > PHP Tutorial > Method to convert signed integer to unsigned integer in PHP_PHP Tutorial

Method to convert signed integer to unsigned integer in PHP_PHP Tutorial

WBOY
Release: 2016-07-13 09:52:37
Original
1299 people have browsed it

How to convert signed integer to unsigned integer in PHP

This article mainly introduces the method of converting signed integer to unsigned integer in PHP. The conversion method is very simple. This article directly gives the conversion method. Friends who need it can refer to it

In a short address project, according to the mutual mapping algorithm of six-digit characters and IDs, when the ID exceeds 2147483647, the ID mapped by the six-digit short address becomes a signed integer.

The code is as follows:

ID > six characters > mapping ID

 ID: 2147483644 > TfffVQ > 2147483644

 ID: 2147483645 > efffVQ > 2147483645

ID: 2147483646 > NfffVQ > 2147483646

ID: 2147483647 > ffffVQ > 2147483647

 ID: 2147483648 > nnnnnu > -2147483648

ID: 2147483649 > dnnnnu > -2147483647

 ID: 2147483650 > rnnnnu > -2147483646

Need to convert signed integer to unsigned integer: (float) sprintf('%u', $id)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1007649.htmlTechArticleConvert signed integer to unsigned integer in PHP. This article mainly introduces the method of converting signed integer to unsigned integer in PHP. The method of converting signed integer type to unsigned integer type is very simple. This article directly gives the conversion...
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