Home  >  Article  >  php教程  >  关于内容分页代码出现的一点问题求助

关于内容分页代码出现的一点问题求助

WBOY
WBOYOriginal
2016-06-07 11:39:101562browse

这代码是tp一位牛人写的。现在我用上后出现所有页面都是显示的第一页的内容,点第2页第3页都显示的第一页的。请问是哪的问题呢?谢谢了
/**<br> * 内容分页<br> * @param text content<br> * @param int  page<br> * @param string needle 分页标识<br> */<br> function contentPage($content, $needle = '<hr>'){<br>     //根据分页标识来拆分分页<br>      $pageContent = explode($needle, $content);<br>     //$_GET['p'] 内容分页的参数<br>        $page = isset($_GET['p']) ? intval($_GET['p']) : 0;<br>     $contentNowPage = $page > 0 ? $page-1 : 0;<br>     echo $pageContent[$contentNowPage];<br>     <br>     if(($pageCount = count($pageContent)) > 1){<br>         $pageStr = '<div></div> <div>';<br>         for($i = 1; $i              $style = '';<br>             if($page == $i){<br>                 $style = 'class="cur"';<br>             }<br>             $pageStr .= '<a>'.$i.'</a>';<br>         }<br>         $pageStr .= '</div>';<br>         echo $pageStr;<br>     }<br> }这代码是tp一位牛人写的。现在我用上后出现所有页面都是显示的第一页的内容,点第2页第3页都显示的第一页的。请问是哪的问题呢?谢谢了

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