So let\'s say I have just-a.domain.com,just-a-domain.info,just.a-domain.net how can I remove the extension .com,.net.info ... and I need the result
just-a.domain.com,just-a-domain.info,just.a-domain.net
.com,.net.info ...
$subject = 'just-a.domain.com'; $result = preg_split('/(?=\.[^.]+$)/', $subject);
This produces the following array
$result[0] == 'just-a.domain'; $result[1] == '.com';