Jump to content

[SOLVED] Accessing associative array via row number


eddy556

Recommended Posts

Why would you want to access an assoc array numerically?  Kind of defeats the purpose of an assoc array.

 

 

As far as I know, there is no way to access it numerically.

 

 

You could ghetto it up though with something like:

 

$i = 0;

 

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

    $array[$i++] =& $array[$key];

}

 

 

That would make numerical indexes that are references to the named ones.

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.