What PHP function can be used to resolve a domain to an IP address?
To resolve a domain to an IP address in PHP, you can use the `gethostbyname()` function. This function takes a domain name as input and returns the corresponding IP address. It can be useful when you need to work with IP addresses instead of domain names in your PHP code.
$domain = "example.com";
$ip_address = gethostbyname($domain);
echo "The IP address of $domain is: $ip_address";
Related questions
-
session user data security
-
comment PHP code
-
include PHP undefined variable