PHP: Check if a URL exists with cURL

In my previous post about email validation one user pointed out that this will not actually validate if a website’s domain actually exists. Here is a simple function that will do just that, determine if a website exists using PHP and cURL.

Edit: After searching a bit, I found another similar cURL solution that checks the actual headers. Since cURL can return HTTP code I don’t think all that extra code is necessary? I could be wrong!