PHP converts signed integer to unsigned integer. php integer _ PHP Tutorial

Source: Internet
Author: User
In PHP, convert signed integer to unsigned integer. In PHP, the signed integer type is converted to the unsigned integer type. in a short address project, the php integer type is based on the ing algorithm between the six characters and the ID, when the ID exceeds 2147483647, PHP converts signed integer to unsigned integer, and php integer

In a short address project, when the ID exceeds 2147483647, the ing ID of a six-character short address is converted into a signed integer.

The code is as follows:
ID> six-character> ing ID

ID: 2147483644> TfffVQ> 2147483644
ID: 2147483645 & gt; efffVQ & gt; 2147483645
ID: 2147483646> NfffVQ> 2147483646
ID: 2147483647> ffffVQ> 2147483647
ID: 2147483648> nnnnnu>-2147483648
ID: 2147483649> dnnnnu>-2147483647
ID: 2147483650> rnnnnu>-2147483646

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

PHP official website information on integer: http://php.net/manual/zh/language.types.integer.php

In a short address project, according to the ing algorithm between the six characters and the ID, when the ID exceeds 2147483647...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.