- strpos: documentation ( source)
- strstr: documentation ( source)
- str_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
$input = 'http://www.oogle.co.uk/';
$url = str_replace('http://', '', strtolower( $input));
if (strpos($url, '/')) $url = strstr($url, '/', true);
echo $url;
?>