Example user input
http://domain.com/
http://domain.com/topic/
http://domain.com/topic/cars/
http://www.domain.com/topic/questions/
I want a php function to make the output like
domain.com
domain.com/topic/
domain.com/topic/cars/
www.domain.com/topic/questions/
Let me know :)
ereg_replace
is now deprecated, so it is better to use:
$url = preg_replace("(^https?://)", "", $url );
This removes either http://
or https://