1
I would like your help for the following problem, I have this code.
function encontrarValor($url){
$dominio = explode(".", parse_url($url, PHP_URL_HOST));
return $dominio[0];
}
It lets you return the host name almost seamlessly. With everything if the host address has www
, it puts the server name as www
.
I would like your help to readjust this code so that even if the url
server whether or not www
, can perfectly identify the server name.
Ever tried to catch
$dominio[1]
when$dominio[0]
is equal to'www'
?– Marcelo Shiniti Uchimura