# How would you get country of origin with an IP using PHP? \[renamed\]

**URL:** <https://forum.kirupa.com/t/how-would-you-get-country-of-origin-with-an-ip-using-php-renamed/101809>\
**Category:** Uncategorized\
**Created:** [February 14, 2004, 7:20am UTC](https://forum.kirupa.com/t/how-would-you-get-country-of-origin-with-an-ip-using-php-renamed/101809 "2004-02-14T07:20:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikini](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nikini/32/225_2.png) [@Nikini](https://forum.kirupa.com/u/Nikini)\
**Post date:** [February 14, 2004, 7:20am UTC](https://forum.kirupa.com/t/how-would-you-get-country-of-origin-with-an-ip-using-php-renamed/101809/1 "2004-02-14T07:20:43Z")

</div>

Is there any command in php to detect the country from the ip?  
Or…how do i detect the country knowing the ip…in php?  
Is there any way…or should i take every first two or three characters from an ip and categorize them…what to do?
