Currently I'm removing https://
and http://
with following code:
$r=\Input::get('searchQuery');
$Query = preg_replace( "#^[^:/.]*[:/]+#i", "", $r);
$Query=rtrim($Query, "/");
I need to remove www.
as well. What should I add to the code inorder to remove www.
Eg: When I search for https://www.example.com/
It should only search for example.com