How do I remove the “http://” from network_site_url?

preg_replace("~^(?:f|ht)tps?://~i", '', $url);

Replaces http https and FTP in string $url

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)