I am entering URL's into my database and i was getting all possible entries
I have the following code that takes the http:// or http or www .com .co.uk away
but the problem is this
when I enter a site like hat.com its taking the 'h' away this happens with t, p, w, and if its .co.uk it only removes the .uk
$new = rtrim($url, "/");
$reverse = strrev( $new );
$new = rtrim($reverse, ".www");
$new = rtrim($reverse, "//:ptth");
$new = rtrim($reverse, ".www//:ptth");
$new = rtrim($reverse, "//:sptth");
$new = rtrim($reverse, ".www//:sptth");
$url = strrev( $new );
Whats have I missed and what would I have to add?