I often hear people say to use \"$_SERVER[\'SERVER_ADDR\']\", but that returns the LAN IP of my server (e.g. 192.168.1.100). I want the external IP.
$_SERVER[\'SERVER_ADDR\']
You could parse it from a service like ip6.me:
\r\nFull results from ip6.me:\r\n"; echo $file;