Forum Moderators: coopster
i need to find a way to shorten a text string (which is basically just a url), so that it just says the domain name.
but they are always in different formats though...
http://example.com
http://www.example.com
http://www.example.com/example/
http://www.example.com/example/example.html
http://www.example.com/?a=example
is there a way of shortening them all to just this instead
example.com
using preg_replace, or something like that? i have been fiddling around with it, but the random nature of the urls is throwing me.