Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Função retorna número da paginação
- function getPage(){
- $page = (isset($_GET['go'])) ? array_filter(explode('/'), $_GET['go'], 'clear') : null;
- if(!is_null($page) && isset($page[1]) && preg_match('^page\:[0-9]+$', $page[1])){
- return (int)str_replace('page:', '', $page[1]);
- }
- return 1;
- }
- //função para utilizar a função array_filter,
- //pra tirar os valores vazios
- function clear($str){
- return !empty()$str;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment