$host = $matches;
preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
Code will parse $rows['url'] which is obviously a data base call from a foreach loop. Preg_match uses regular expressions to cut away unwanted url attachments but will retain url integrity so that when user's click on link they will still be brought to the website in question.
e.g. My cool website (mywebsite.com) <-- shortened url will be displayed.