Home

Published

- 1 min read

remove http / https from link php

img of remove http / https from link php

The solution for this is noted below

Solution

   function remove_http($url) {
   $disallowed = array('http://', 'https://');
   foreach($disallowed as $d) {
      if(strpos($url, $d) === 0) {
         return str_replace($d, '', $url);
      }
   }
   return $url;
}

Try other methods by searching on the site. That is if this doesn’t work