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 ...
strrpos($str, ".")
Will give you the index for the last period in your string, then you can use substr() with the index and return the short string.
substr()