# array-paging **Repository Path**: zms-code/array-paging ## Basic Information - **Project Name**: array-paging - **Description**: 数组分页 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-25 - **Last Updated**: 2025-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # array-paging #### 数组分页搜索器 数据必须是数组列表,非PHP广义的数组 - 数组key必须是0开始自然增加 - 数组内每一项元素的结构必须相同 ```php //简单分页 "2006", "name" => "辽沈银行"], ["code" => "2007", "name" => "滦平盛阳村镇银行"], ["code" => "2008", "name" => "韩城浦发村镇银行"], ["code" => "2009", "name" => "安徽宁国农村商业银行"], ["code" => "2010", "name" => "兴福村镇银行"], ["code" => "2011", "name" => "河间市农村信用合作联社"], ["code" => "2012", "name" => "河北南皮农村商业银行"], ["code" => "2013", "name" => "汨罗中银富登村镇银行"], ["code" => "2014", "name" => "陆良兴福村镇银行"], ["code" => "2015", "name" => "容城县农村信用合作联社王村信用社"] ]; $paging=new ArrayPaging($data,10,1); $data=$paging->search(); //分页搜索 where)===0){ return $this->data; } $result=[]; foreach($this->data as $item){ if(isset($this->where['code']) && Is::notEmpty($this->where['code'])){ if($this->where['code']!==$item['code']){ continue; } } $result[]=$item; } return $result; } } $paging=new ArraySearch($data,10,1); $paging->setWhere([ 'code'=>'3356' ]); $data=$paging->search(); ```