To return the IP address of the client in PHP, you can use the following code:
php
$ip_address = $_SERVER[“REMOTE_ADDR”]; echo$ip_address;
This code uses the $_SERVER
variable, specifically the REMOTE_ADDR
property, to retrieve the client’s IP address.
Leave a Reply