I'm using echo network_site_url();
to place the url of each site in a WordPress MultiSite installation. This outputs http://site.com/
How do I remove the http://
and trailing slash?
Thanks.
preg_replace("~^(?:f|ht)tps?://~i", '', $url);
Replaces http https and FTP in string $url
echo preg_replace("~^(?:f|ht)tps?://~i", '', network_site_url());
Commented
Dec 18, 2011 at 7:57