Currently I am using this code to get the domain name (without www. or domain ending like .com):
explode('.', $url)[1];
Due to the fact that this code is in a loop it takes very long to handle it. Furthermore it can not get "example" from http://example.com/asd/asd.asd.html. Is there another and faster way to solve this?
Thank you for any answer in advance!
best greetings