Home > php教程 > php手册 > body text

分页时,带入查询条件

WBOY
Release: 2016-06-07 11:40:19
Original
1602 people have browsed it

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

//第一种方法使用".="
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元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template