Home >php教程 >php手册 >分页时,带入查询条件

分页时,带入查询条件

WBOY
WBOYOriginal
2016-06-07 11:40:191620browse

分页时,带入查询条件集中方法

//第一种方法使用".="
foreach($map as $key=>$val) {
$Page->parameter .= "$key=".urlencode($val).'&';
}


//第二种方法使用"="
foreach ($map as $key => $value) {
$Page->parameter[$key] = urlencode($value);
}


//第三种方法,在new 分页类的时候,当作第三个参数传入
$page = new \Think\Page($count, $page_count,$url_map);

或者:$page = new \Think\Page($count, $page_count,I(''));

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn