say someone enters a URL like this:
http://i.imgur.com/a/b/c?query=value&query2=value
And I want to return: imgur.com
not i.imgur.com
This is code I have right now
$sourceUrl = parse_url($url);
$sourceUrl = $sourceUrl['host'];
But this returns i.imgur.com
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…