note 40884 deleted from function.stream-socket-get-name by nlopess
| From: | nlopess@php.net | Date: | Thu, 18 Mar 2004 13:47:43 +0000 |
| Subject: | note 40884 deleted from function.stream-socket-get-name by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67013@lists.php.net to get a copy of this message | ||
Note Submitter: peetah@adsl.no
----
This function might seem confusing; But here's an example of retrieving the IPaddress of the
connecting client:
$ip = stream_get_socket_name($connection, TRUE);
print("IP: $ip");
// Returned: IP: 192.168.1.33 (Client Address)
While this example will retrieve the server address:
$ip = stream_get_socket_name($connection, FALSE);
print("IP: $ip");
// Returned: IP: 192.168.1.34 (Server Address)