How To Use The next() and prev() functions on multi-dimensional arrays

From: Date: Fri, 27 Dec 2002 04:49:38 +0000
Subject: How To Use The next() and prev() functions on multi-dimensional arrays
Groups: php.general 
Request: Send a blank email to php-general+get-129411@lists.php.net to get a copy of this message
Hello Everyone, I have a multi-dimensional array called $cat_data, and I need to access certain elements in the array using the next() and prev() functions. I did consider using loops like for, foreach, and while...but for this particular application, I don't want to loop through the entire array. Also, I need everything in that array, so no I don't want to limit the data drawn from the database. I know the two above mentioned functions work with normal arrays, but how would I make it work with multi-dimensional arrays? The following is a little idea of the structure of the array: $cat_data[$a][$b] where $a is the row number from the database, and $b is the column being accessed. $cat_data[0][0] = the first row of the id column. $cat_data[0][1] = the first row of the name column.

« previous php.general (#129411) next »