I trying to split my static URL and get its value in my SQL Query.
www.mydomain.com/directory/A/37/257/file.html
I want to put url values LIKE
$a="A";
$b=37;
$c=257;
Please help me to split the above mention url.
Thanks
I trying to split my static URL and get its value in my SQL Query.
www.mydomain.com/directory/A/37/257/file.html
I want to put url values LIKE
$a="A";
$b=37;
$c=257;
Please help me to split the above mention url.
Thanks
Try:
$params = explode('/', $_SERVER['REQUEST_URI']);
$a = $params[2];
$b = $params[3];
//...
Note this will give you the parameters as strings. You can use intval()
to convert any integer parameters.