Ex, i have an address like this, http://www.abc.com.st/bbb/e/index.htm, i want to get the www.abc.com or abc.com and test them if these are the problems as connection failed or connection refused or object not found, etc. .
You could use parse_url
http://ch.php.net/manual/en/function.parse-url.php
but how to detemine the domain is found or accessible?
perhaps try to connect with [man]fsockopen/man or something?
yes, but how to control the timeout of fsockopen when it occers the problem of connection ?
Check out this article at Sitepoint: http://www.sitepoint.com/article/1051