Re: array_pop() with key-value pair ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mikey wrote:
I guess you have tried foreach?

foreach ($array as $key => $value) {
    ...
}

No.. loop should not be necessary when you want to take only the first or the last element in the array. Better using array_pop() array_shift() reset() end() and each() functions for better run times.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux