Extract hostname from URL


/ Published in: PHP
Save to your folder(s)

Extract hostname from URL


Copy this code and paste it in your HTML
  1. $hostname = str_replace(strstr(substr(strstr($url,'://'),3),'/'), '', $url);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.