stacks stacks - 9 months ago 47
PHP Question

PHP url question

Is there a way I can strip out the variables from a link using PHP for example, if I have a link that reads

http://localhost/link/index.php?s=30&p=3
how would I strip out
?s=30&p=3
so my link reads
http://localhost/link/index.php

Answer Source
list($url) = explode("?", $longUrl, 2);