Home  >  Article  >  Backend Development  >  Method to convert signed integer to unsigned integer in PHP, php integer_PHP tutorial

Method to convert signed integer to unsigned integer in PHP, php integer_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:52:181611browse

Convert signed integer to unsigned integer in PHP. PHP integer

In a short address project, based on the mutual mapping between six characters and ID Algorithm, when the ID exceeds 2147483647, the ID mapped by the six-character short address becomes a signed integer.

Copy code The code is as follows:
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)

Information about integers on the PHP official website: http://php.net/manual/zh/language.types.integer.php

http://www.bkjia.com/PHPjc/1008024.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1008024.htmlTechArticleHow to convert signed integer to unsigned integer in PHP, php integer is in a short address project , according to the mutual mapping algorithm of six characters and ID, when the ID exceeds 2147483647, six...
Statement:
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