Determine whether a domain name exists? Welcome to the solutions for heroes with collection experience

Source: Internet
Author: User
Determine whether a domain name exists? Welcome to collect experienced heroes to determine whether a domain name can be opened. I have used many methods, curl_init, fsockopen, file_get_content ($ url, NULL, $ text) $ text indicates that the establishment of stream_context_create times out, but does it determine whether a domain name exists? Welcome to heroes with collection experience
To determine whether a domain name can be opened, I have used many methods, including curl_init, fsockopen, file_get_content ($ url, NULL, $ text), where $ text indicates stream_context_create creation timeout, however, it does not work for domain names that cannot be opened. here, it refers to opening blank pages (no HTML, no HEAD, no BODY), expired pages, and redirection effects. for details, refer
$ Arr = array ("http://www.baidu.com", "http://www.ccin.cc", "http://www.contourdes.com ");
In this data
$ Arr [0] The website is normal and there is no doubt there is no problem;
$ Arr [1] The website cannot be opened. if there is a problem, this is my problem. how can I judge and skip this issue? the curl_init, fsockopen, and file_get_content methods all set a timeout value during retrieval, if no timeout interrupt is set, try-catch can obtain the PHP has encountered an Access Violation at 7C95B56B.
$ Arr [2] The website expires. you can use get_headers or the method above to obtain the value.

------ Solution --------------------
Can I go directly to the domain name management website?
------ Solution --------------------
Get_headers

It cannot be reversed. None of the websites containing 200 of them can be accessed on the journey.
------ Solution --------------------
Right? Does curl return no error for the http://www.ccin.cc? So what did you get?


--------------------------------
Based on the plug-in extension function provided by the CSDN forum, I have made a signing tool and shared it with you. we welcome Technical Exchange :)
------ Solution --------------------
I have been doing this for a month.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.