Jump to content

Edit array key?


LemonInflux

Recommended Posts

Uhh, not sure if there's an easier way to do it, but this would work:

 

$keys = array_keys($testarray);

$values = array_values($testarray);

 

$keys[0] = "testEditkey";

$newarray = array_combine($keys, $values);

 

>_>  Probably an easier way to do it, but I just can't think of it.

Link to comment
https://forums.phpfreaks.com/topic/104080-edit-array-key/#findComment-532812
Share on other sites

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.