Page 1 of 1

rtrim a URL

Posted: Fri Jun 11, 2010 10:33 am
by dimxasnewfrozen
I have a url like:
"http://www.example.com/mem.php?myInquir ... h=47423628#"

I need to get the actual page URL without the options at the end:
"http://www.example.com/mem.php"

I'm just looking to use a simple rtrim but I'm not sure how to format it.

Re: rtrim a URL

Posted: Fri Jun 11, 2010 12:33 pm
by cpetercarter

Code: Select all

$bits = explode("?", $url);
$trimmed_url = $bits[0];