Jump to content

Modifying the pointer for a multidimensional array


cyberRobot

Recommended Posts

I have a multidimensional array that looks like:

$matchingResults[342] = array(id => 342, title => 'Some awesome resource', matches => 3);
$matchingResults[5]   = array(id => 5,   title => 'A great resource',      matches => 1);
$matchingResults[200] = array(id => 200, title => 'Another ok resource',   matches => 1);

 

 

This array may contain hundreds of items and I want to only display 10 items per page. Is there a simple offset function that I can use to adjust the array pointer.

 

I was thinking about writing a function which would use a loop to manually change the pointer with the next() function. But it seems like there should be a function already available.

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.