Organizational Research By

Surprising Reserch Topic

how can i get the paramter of url contains slash


how can i get the paramter of url contains slash  using -'php,zend-framework,frameworks,php-5.5'

I have this URL :

 dev.local.co/fr/admin/quoteManag/addquote/numberModel/123456/5


when I want to get the parameter numberModel.

On var_dump I get just "123456", not "123456/5"
    

asked Oct 19, 2015 by mannumits1
0 votes
17 views



Related Hot Questions

2 Answers

0 votes

You can use urlencode

$parameter = urlencode('123456/5'); // 123456%2F5

echo urldecode($_GET['numberModel']); // 123456/5

Or in your router, create a regex that will accept the slash as part of the parameter.

$route = new Zend_Controller_Router_Route_Regex("numberModel/([0-9\/]*)", array("module" => "MODULE", "controller" => "CONTROLLER", "action" => "ACTION"), array(1 => "numberModel"));
answered Oct 19, 2015 by yashwantpinge
0 votes

Not 100% but if this was me, I would get the url, explode it using / Get the last 2 from the array, implode them.

But it depends on how you get the url, do you have a rewrite rule? If so then I would look in that and you need to just sharpen it up slightly.

answered Oct 19, 2015 by mtabakade

...