How to get client IP address

Hi, I am using php JSON API for my app content, when I access my API from browser I am getting my IP in my API using php function $_SERVER[‘REMOTE_ADDR’] but when I access API from my ionic2 app it’s giving me server IP instead of client IP so is there any setting to solve this?