There is no general function to check
any URL, but you can check an
http:// URL for readability easily enough -
example. The only way to test for mailto: type URLs is to send an email to the URL and see if the owner of the URL responds, and you're not going to find it very easy to check for the existance of
http:// web pages within directories for which authorisation is required.
Note that testing a remote URL will cause your enquiry to be recorded in log files that the server there is probably keeping, and that you should respect the robots exclusion standard is you're doing more than a handful of tests.