CodeIgniter -> Get current URL relative to base url

后端 未结 10 1202
情话喂你
情话喂你 2020-12-29 05:08

Tried URI::uri_string() but can\'t get it to work with the base_url.

URL: http://localhost/dropbox/derrek/shopredux/ahahaha/hihihi
Returns: dr

10条回答
  •  佛祖请我去吃肉
    2020-12-29 05:37

    Try to use "uri" segments like:

    $this->uri->segment(5);   //To get 'ahahaha'
    $this->uri->segment(6);   //To get 'hihihi
    

    form your first URL...You get '' from second URl also for segment(5),segment(6) also because they are empty.

    Every segment function counts starts form localhost as '1' and symultaneous segments

提交回复
热议问题