Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:26:20+00:00 2026-06-08T12:26:20+00:00

If we have an ip address as below: 127.0.0.1 Does both functions convert the

  • 0

If we have an ip address as below:

127.0.0.1

Does both functions convert the ip address to the same number, or do they differ and have different result?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:26:22+00:00Added an answer on June 8, 2026 at 12:26 pm

    They are almost exactly the same. ip2long sometimes returns a negative value because PHP uses signed numbers for valuation, while MySQL uses unsigned.

    Both are evaluated as x*(2^24) + y*(2^16) + z*(2^8) + w*(2^0), but in PHP, due to the long being signed, will show negative values for certain IP addresses.

    For signed long, the range is 
    (2^31) - 1 = −2,147,483,648 to +2,147,483,647
    

    So, addresses while translate to over +2,147,483,647 will wrap around and give negative values.

    ip2long("254.254.254.254"); // -16843010
    

    This link describes this in detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a simple address class like below: public class Address { public
I have below tables 1. Address -> AddressID 2. Designation -> DesignationID 3. Stores
I have a shipping form. Three input fields surround the shipping address. Below are
When 127.0.0.1 below is omitted app.address() is not null, but when a host is
I have a method below which converts an address to longtitude/latitude. LatLng is a
I have the below code in my Magento store it adds the customers address
In the code below I have 3 functions (including main ). The receive_loop function
We have created one list its name is => MobileTechSupport but in Web Address(below)
I have map.html which shows a US map and address details below it: <img
I have a controller (address /Home/Test see below) which definately responds to get request

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.