I have some domains I want to split but can\'t figure out the regex...
I have:
http://www.google.com/tomato
http://int.google.c
$res = preg_replace( "/^(http:\/\/)([a-z_\-]+\.)*([a-z_\-]+)\.(com|co.uk|net)\/.*$/im", "\$3", $in );
Add as much endings as you know
Edit: made a mistake :-(