In the past I used
$ip = $_SERVER["REMOTE_ADDR"];
Which would return the client's IP. I've recently started hosting my site with Heroku, and I found that the above code no longer returns the client IP.
Has anyone come across this? How would I use PHP to obtain the real IP address of the client if my site is hosted with Heroku?