CodeIgniter Forums
uri_to_assoc issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: uri_to_assoc issue (/thread-46490.html)



uri_to_assoc issue - El Forum - 11-02-2011

[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
Quote: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
Quote: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.