Folks,
When a user inputs his domain name (just the domain name. Eg. webmastersun.com) into my form field, I want the form to check if the domain is valid.
1. I don't care if the inserted domain is registered or not. Nor care if it is functional or not. Aslong as it is a valid domain then that should be accepted.
2. This time, I need to make sure the domain is registered and functional.
I am spoilt for choice as too many code samples presented here:
https://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php
Which code sample from the above link would you use to satisfy my question number 1 and why particularly that one and not the others ?
And, which one would you use to satisfy my question number 2 and why particularly that one over the others ?
When a user inputs his domain name (just the domain name. Eg. webmastersun.com) into my form field, I want the form to check if the domain is valid.
1. I don't care if the inserted domain is registered or not. Nor care if it is functional or not. Aslong as it is a valid domain then that should be accepted.
2. This time, I need to make sure the domain is registered and functional.
I am spoilt for choice as too many code samples presented here:
https://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php
Which code sample from the above link would you use to satisfy my question number 1 and why particularly that one and not the others ?
And, which one would you use to satisfy my question number 2 and why particularly that one over the others ?