function page_content($content,$limit = 10,$page) {
        $limit=20;

        $afile = explode("\r\n", $content);
        $maxline = count($afile);           // count existing lines
        $max = $maxline - 1;
        $page ? $page = $page : $page = 1;
        $s=$page+$limit;
        for ($i=$page; $i<$s; $i++) {
           $dtrow = explode("|", $afile[$i]);
           $row = "$dtrow[0]";
           $formatted_content .= $row."\n";
        }

        $p = 1;
        $u = ceil($max/$limit);
        for ($t=1; $t<=$u; $t++) {
               $formatted_content .= "<a href=\"$PHP_SELF?
page=$p\">$t</a> ";
                $p=$p+$limit;
        }
        return $formatted_content;
}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to