Array pagination

Discussion in 'PHP' started by astrazone, Aug 16, 2009.

  1. #1
    I have an array something like (array(1 => info, 2 => more info, 3 => even more info));)

    I do:
    
    <?php
    $arts=$xpath->query
    ("/site/categories/);
    		foreach($arts as $art){
    			$name = $art->getAttribute("name");
    			?>
    HTML code that uses $name goes here.
    
    PHP:
    and I end up with a page full with diffrent content.
    sometimes its bigger than the page.
    how can I split it into pages?
     
    astrazone, Aug 16, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Split what into pages? Why are you even using xpath?
     
    premiumscripts, Aug 16, 2009 IP
  3. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    I retrieve the attributes from the xml and show them in HTML.
    for each $name it creates a box with that name.
    in some cases there are too much names.
    I need to split it into pages.
     
    astrazone, Aug 16, 2009 IP
  4. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #4
    never mind I figured it out myself...
    it funny how I open a thread and a minute after I have the code working.
     
    astrazone, Aug 16, 2009 IP