Re: [PHP] gettting last assigned key in an array

2006-02-10 Thread Evan Priestley
function get_last_key( $array ) { // end( $array ); return key( $array ); return array_search( reset( array_reverse( array_values( array_flip( $array ) ) ) ) ,array_reverse( array_values( array_flip( $array ) ) ) ,true

Re: [PHP] gettting last assigned key in an array

2006-02-10 Thread Curt Zirzow
On Fri, Feb 10, 2006 at 11:39:13AM -0800, jonathan wrote: im mapping some data from a sql select into a custom object that will have a couple associative arrays. I have some code that I think looks a little ugly such as: $x=0; if($row['slot']=2) {

Re: [PHP] gettting last assigned key in an array

2006-02-10 Thread Richard Lynch
On Fri, February 10, 2006 1:39 pm, jonathan wrote: im mapping some data from a sql select into a custom object that will have a couple associative arrays. I have some code that I think looks a little ugly such as: $x=0; if($row['slot']=2) {