What about using array_pop to take the bottom array element from the
first one and add it to the second?
So basically you are feeding the 2nd array from the bottom of the 1st
one, and assuming garbage collection is done for each call of array_pop,
then you'd only need the memory usage of one cop
Hi,]
So I've been thinking, because occassionally I do, about
array_reverse() and how to implement it. Of course, it's entirely
theoretical, because it would a total waste of time. But I'm wondering
which of two methods would be best.
1. Do it "correctly" and in place. ie, loop through the the fi
AMI> This would echo info by the order of the "id".
I would recommend doing that in your SQL, unless you're doing other
special processing.
// for ascending order
SELECT * FROM personnel ORDER BY id ASC
// for descending order, aka reverse
SELECT * FROM personnel ORDER BY id DESC
- Julie
-
I have problem with array_reverse.
I just want to call info from my MySQL / db / table / and display the
info in reverse.
here is a sample of the code:
";
echo"Full NameNick
NameOptions";
while($myrow = mysql_fetch_array($result))
{
echo "".$myrow["firstname"]."
".$myrow["lastname"]."".
Monday, June 10, 2002, 5:12:50 PM, you wrote:
> Monday, June 10, 2002, 5:07:48 PM, you wrote:
>> Does anyone have or know of a function that will take an array and
>> do array_reverse() recursively? I have the following array/structure:
> Something like this (UNTESTED!!)...
> function recurs
Monday, June 10, 2002, 5:07:48 PM, you wrote:
> Does anyone have or know of a function that will take an array and
> do array_reverse() recursively? I have the following array/structure:
Something like this (UNTESTED!!)...
function recursive_array_reverse($arr)
{
foreach ($arr as $key =>
Does anyone have or know of a function that will take an array and
do array_reverse() recursively? I have the following array/structure:
Array
(
[0] => Array
(
[0] => Array
(
[0] => bob
)
)
[1] => Array
7 matches
Mail list logo