Article/Blog Pagination with PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gamernaveen
    New Member
    • Oct 2007
    • 28

    Article/Blog Pagination with PHP

    Hey guys , I have my blog script ready ...
    anyway as am making it for mobile phones ,
    the blogs must be split into pages to make
    it viewable. I already know MySQL PHP
    pagination with those LIMIT query etc.

    However , I need to split the article itself into pages.
    Say ,
    [PHP]
    <?
    $body="You will learn a lot more by attempting the problem yourself and asking for help with the bits that are not working and you will be more likely to get help if you appear to have made an attempt at the problem yourself.";
    ?>
    [/PHP]
    The body variable contains that paragraph.
    I need to split the article and make view
    25 chars a line , and 5 lines a page.
    How do I do this ?
    Please help me asap.

    Thanks so much.
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Not sure. But a long way to do it would be to count the characters then insert a <br /> and loop it for 4 times then go onto another function to create a new page, and then loop those two functions until the remaining paragraph is NULL?

    Comment

    • gamernaveen
      New Member
      • Oct 2007
      • 28

      #3
      Originally posted by TheServant
      Not sure. But a long way to do it would be to count the characters then insert a <br /> and loop it for 4 times then go onto another function to create a new page, and then loop those two functions until the remaining paragraph is NULL?
      Well I just found the lovely PEAR:Pager package , it works fine , ty....

      Comment

      Working...