I have a script which sends a request to another server but problem is that IPv6 does not supported so if I send IPv6 then give error so i need this one of two:
IPv4 address all time
orIPv4 and IPv6 addressesI use this code to get the IP address
$ip = $_SERVER["REMOTE_ADDR"];
But this function only returns one IPv address. How can I get all time IPv4 or get both addresses?
You can't.
Only the IP address the request came from is available.
There's no reliable way to identify other IP addresses (my laptop currently has 12 IP addresses) that route to the same computer.