Context:
I want to detect the two letter continent code of my user(s) to allow me to conditionally display an American or more general phone number.
E.g. If continent code is North America or South America, display North American phone number. Else, display general international phone number.
What I've tried:
- A similar question on Stack Overflow was resolved using a light-weight function however in my case, the function did not output anything (i.e. blank).
- The PHP manual lists the geoip_continent_code_by_name function of GEOIP extension however installation of this extension seems overkill and besides, I'm in no way familiar with command line installs for WHM/cPanel.
My question:
Is there an easier and lighter-weight method of detecting the two-letter continent code by IP?