Welcome Guest, Not a member yet? Register   Sign In
uri_to_assoc issue
#1

[eluser]Arun Joshi[/eluser]
This is my code
Code:
$default = array('location', 'id', 'page');
$url_info = $this->uri->uri_to_assoc(3, $default);
var_dump($url_info);

If my url is

Code:
http://localhost/cidbg/test/uritest/location/india/page/8/id/58

Then my $url_info is ok.
Code:
array
  'location' => string 'india' (length=5)
  'page' => string '8' (length=1)
  'id' => string '58' (length=2)



But when my url is

Code:
http://localhost/cidbg/test/uritest/location/india/page//id/58

Then my $url_info is like this.
Code:
array
  'location' => string 'india' (length=5)
  'page' => string 'id' (length=2)
  58 => boolean false
  'id' => boolean false



The page variable is missing there. Actually am expecting page to FALSE. Is there anyway to achive this? I mean if a value is missing, then that name should be false.




Theme © iAndrew 2016 - Forum software by © MyBB