【问题标题】:How to count total number of segments in codeigniter?如何计算codeigniter中的段总数?
【发布时间】:2014-08-02 09:51:35
【问题描述】:

我想计算 codeigniter 中的段总数,以便在用户/访问者在我的 url 中输入其他段时显示错误。

【问题讨论】:

    标签: php codeigniter url segments


    【解决方案1】:

    您检查过manual 了吗?有这样的方法可以得到总段数。 $this->uri->total_segments()

    或者你也可以使用$this->uri->segment_array()

    $total = count($this->uri->segment_array());
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-09
      • 1970-01-01
      • 1970-01-01
      • 2021-10-09
      • 2013-05-09
      • 2020-11-14
      相关资源
      最近更新 更多