Jump to content

[SOLVED] Controlling amount of results outputted by an array


Michan

Recommended Posts

Hi all,

 

Say I have an array of twenty results; how would I output, for example, results # 5 - 10 (for pagination)?

 

Here is 1 - 5:

$i = 0;

foreach($topiclist as $key => $val) {

echo $val.'<hr>';

if(++$i==5) { break; }

}

 

Many thanks in advance,

 

- Mi

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.