¡@

Home 

php Programming Glossary: hostdata

How can I get the base domain name from a URL, using PHP? eg google.com from images.google.com

http://stackoverflow.com/questions/3211411/how-can-i-get-the-base-domain-name-from-a-url-using-php-eg-google-com-from-ima

host url http www.google.co.uk urlData parse_url url hostData explode '.' urlData 'host' hostData array_reverse hostData if.. urlData parse_url url hostData explode '.' urlData 'host' hostData array_reverse hostData if array_search hostData 1 . '.' . hostData.. hostData explode '.' urlData 'host' hostData array_reverse hostData if array_search hostData 1 . '.' . hostData 0 urlMap FALSE host..