title: Extract all the named parameters from a given url in cakephp
body: <p>I have 1 doubt regarding this...</p>
  
  <p>i have a url like this</p>
  
  <p><a href="http://www.SpiderWeb.com/vendors/search_results/scid:0/atr:1/mbp:1/bc:2/bc:1/mbpo:2/atrt:5/atop:1/opel:4" rel="nofollow">http://www.SpiderWeb.com/vendors/search_results/scid:0/atr:1/mbp:1/bc:2/bc:1/mbpo:2/atrt:5/atop:1/opel:4</a></p>
  
  <p>I want to extract all the named parameters in an array vars such that I have the name of the variable as well it's value in the url so that I can use them for some processing...</p>
  
  <p>Is there some way by which i can achieve this uisng some build-in functions rather than assiging them individually </p>
  
  <p>i.e  </p>
  
  <pre><code>$some_var = $this-&gt;request-&gt;params['named']['id']; 
  </code></pre>
  
  <p>The resaon i want it is because the named parameters are dynamic ....</p>
  
  <p>heres the updated solution for this...</p>
  
  <pre><code>&lt;?php
  $url = 'http://www.SpiderWeb.com/vendors/search_results/scid:0/atr:1/mbp:1/bc:2/bct:1/mbpo:2/atrt:5/atop:1/opel:4';
  $arr_url = parse_url($url);
  //print_r($arr_url);
  $res  = explode("/vendors/search_results/",$arr_url['path']);
  //print_r($res);
  //print_r($res[1]);
  $vars  = explode("/",$res[1]);
  //print_r($vars);
  $result = array();
  foreach($vars as $key =&gt; $val){
    if (strpos($val, ":") !== false) {
       $newvars  = explode(":",$val);
       //print_r($newvars);
       $result[$newvars[0]] = $newvars[1];
    }
  }
  print_r($result);
  ?&gt;
  </code></pre>