Say I have the following URL:
http://example.com/safety-checks/?carid=63&interval=2
And am getting the current url by doing
$current_url = $_SERVER['REQUEST_URI'];
How would I go about stripping the &interval=# but leaving the carid value?
Say I have the following URL:
http://example.com/safety-checks/?carid=63&interval=2
And am getting the current url by doing
$current_url = $_SERVER['REQUEST_URI'];
How would I go about stripping the &interval=# but leaving the carid value?
Try explode
This should return up to the carid. The ampersand and everything following it is removed.
$noInterval = explode("&", $current_url)[0]