Back to feed
Dev.to
Dev.to
7/14/2026
The original title is "Getting the public IP in PHP — no dependencies, no API key"

The original title is "Getting the public IP in PHP — no dependencies, no API key"

Original: Getting the public IP in PHP — no dependencies, no API key

Short summary

A tutorial on retrieving public IP addresses in PHP using the IPPubblico.org API, covering plain text and JSON endpoints with cURL examples. Includes localized geolocation responses and client IP detection behind proxies. The content heavily promotes a single third-party service throughout.

  • Use file_get_contents or cURL to fetch public IP from IPPubblico.org without API keys
  • JSON endpoint provides country, city, ISP, and timezone with localized language support
  • Client IP detection handles Cloudflare, Nginx, and standard proxy headers

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more