ex : www.dev.com/admin/function/234_23 我必须重定向回 www.dev.com/admin/function/234 ID 23 后编辑并再次提交
在 CodeIgniter$this->uri->segment($this->uri->total_segments())
中,获取最后一个 URI 段234_23
。然后,您可以使用strstr()
获取_
之前的所有文本,如下所示
$oldSegment = $this->uri->segment($this->uri->total_segments());
$newSegment = strstr("$oldSegment", "_", true);
然后将redirect()
与$newSegment
一起使用
$this->session->set_flashdata('sucess_msg', 'Record Updated Sucessfully!');
redirect('user-information', 'refresh'); //user-information is route name or you can name function here as well depending upon your requirements