How can I get the client’s IP address in a PHP webservice? [duplicate]

This should be what you want:

$_SERVER['REMOTE_ADDR']

The IP address from which the user is
viewing the current page.

http://php.net/manual/en/reserved.variables.server.php

Leave a Comment