I have this url: http:www.blabla.com/x/x/x/x?username=testuser
I need a string to read this url, but forget everything and including the ?
mark.
So it becomes this: http:www.blabla.com/x/x/x/x
The reason for this is because I am making this variable:
$host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
And this code:
if($host == "http:www.blabla.com/x/x/x/x") {
echo "lul";
}
But right now, the URL changes depending on what user is on, and it has to execute the echo
no matter what user is on.
So I read some reges and preg_match
etc. and I just wanted to hear your opinions or advice. How would I accomblish this the best? thanks!