i want to remove
http://
ftp://
https://
ftps://
http://www.
https://www.
ftp://www.
ftps://www.
www.
we want to remove if anyone above with domain url. we want only show url
domain.com
we try preg_replacefor http and https. its work fine for both, but its not work. if found www or ftp
preg_replace('#^https?://#', '', $str)
Might be a better one but this should do it:
$result = preg_replace('#^(https?://|ftps?://)?(www.)?#', '', $str);