for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of dispositif/wikibot application (@github)
* 2019/2020 © Philippe M. <[email protected]>
* For the full copyright and MIT license information, please view the license file.
*/
declare(strict_types=1);
namespace App\Domain;
use App\Application\Http\ExternHttpClient;
class ExternDomains
{
public static function extractSubDomain(string $url): string
if (!ExternHttpClient::isWebURL($url)) {
throw new \Exception('string is not an URL');
}
$parseURL = parse_url($url);
return str_replace('www.', '', $parseURL['host']);