本文介绍了代码Igniter - 获取上一个URI段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我打算获取CI中的最后一个URI段,但是我不知道它的编号是多少,因为用户点击页面中的链接时会附加参数(整数)。
I'm tying to get the last URI segment in CI, however I don't know what the number for it will be, as parameters (an integer) will be appended as the user clicks links within the page. These are then used in a controller to pull relevant database records into the page via ajax.
如何告诉CI获取最后一个分段?
How can I tell CI to get the last segment?
类似:
$record_num = $this->uri->segment($last);
$ b
谢谢!
Thanks!
推荐答案
$record_num = end($this->uri->segment_array());
这篇关于代码Igniter - 获取上一个URI段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!