Hi there,
I'm still trying to get my head around ereg_replace() and preg_repace().
I have a redirection script for unused domains, it takes a 'fromdomain' variable and a 'todomain' variable records hits in a MySQL database and redirects.
However, I have some domains where requests are being made to pages on the domain.
If I have
fromdomain = 'http://www.mydomain.com/obsoletepage.html'
I want to strip off the 'obsoletepage.html' bit before storing in the DB. How can I convert
fromdomain = 'http://www.mydomain.com/obsoletepage.html'
into
fromdomain = 'http://www.mydomain.com/'
only.
Thanks for any help.