kboyd,
@kboyd@phpc.social avatar

Here's how to pretend that array_map supports passing keys in

$keys = array_keys($data);  
array_combine(  
 $keys,  
 array_map(  
 fn ($values, $key) => ... ,  
 $data,  
 $keys  
 )  
);  

Keys tend to be important in PHP because they are often strings that contain relevant data, rather than index offsets.

Dropping the array_combine would result in losing all of the keys from the resulting array & reverting to int offsets.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • magazineikmin
  • thenastyranch
  • hgfsjryuu7
  • Youngstown
  • rosin
  • InstantRegret
  • slotface
  • mdbf
  • PowerRangers
  • tsrsr
  • kavyap
  • khanakhh
  • vwfavf
  • normalnudes
  • ngwrru68w68
  • ethstaker
  • tacticalgear
  • cubers
  • Durango
  • everett
  • osvaldo12
  • modclub
  • tester
  • cisconetworking
  • GTA5RPClips
  • Leos
  • anitta
  • All magazines