- PHP Regex to Remove http:// from string
- $str = 'http://www.google.com';
- $str = preg_replace('#http://|https://#', '', $str);
- echo $str; // www.google.com
- preg_match( "/^(https?://)?(.+)$/", $input, $matches );
- $url = $matches[0][2];
- str_replace('http://', '', $subject);
- str_replace('https://', '', $subject);