3
How to get the name of host of a URL like Mega, 4shared among others with PHP?
In case you would like to know taking this URL as an example:
https://mega.co.nz/#! 4090kJrY! Lzizbgsoo_gg1slnykzlhsuthac9oaprg3--0gD92Y
How can I get from this URL only the word MEGA
discarding all the rest?
I found this type of code on the Internet which picks up the name of the host only it does not do what I want because it leaves the www and the domain I just want to leave the host name.
$host = $_SERVER['HTTP_HOST'];
echo $host;
Then explain better what you want. Separate the text further to make it clearer, give some example, show what you did and what is wrong. Make sure you are using the correct terms if you are citing the situation that the information is obtained properly. http://php.net/manual/en/reserved.variables.server.php
– Maniero
ready I hope now you understand
– Striffer