c# - PHP Get IP based on host name
Get the solution ↓↓↓Solution:
you can use the php dns_get_record function
array dns_get_record ( string $hostname [, int $type = DNS_ANY [, array &$authns [, array &$addtl [, bool &$raw = false ]]]] )
And then look in the array for a record of type A (means IPv4)
Answer
Solution:
There are 2 Solution to get Host IP using 2 predefined functions
$ip = gethostbyname('php.net');
echo $ip;
$result = dns_get_record("php.net");
print_r($result);
Will work it out when you have access to those sites through your firewall. it they blocked then you will see your local ip instead of the desired site IP.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.