这将返回我分页的结果。我想获取参数并将它们附加到分页链接,以便在页面之间导航时保持搜索结果。
提前致谢
答案 0 :(得分:0)
$categories = $_GET['data']['categories'];
foreach($categories as $array) {
foreach($array as $category) {
echo $category."<br/>";
}
}
根据您的评论如下:
$categories = $_GET['data']['categories'];
foreach($categories as $array) {
foreach($array as $category) {
$category = intval($category); // anty-injection, we assumed $category is a number
echo '<a href="domain.com?'.$category.'">Category #'.$category.'</a><br/>';
}
}
答案 1 :(得分:0)
经过大量搜索,我发现了这个函数http_build_query(),这正是我想要的:)