What is a better way to replace IDs in an array with their value counterpart?
问题 I have the following array that includes id: [Key1] => 1 [Key2] => 2, 3 I would like to replace these ids by their respective name from this second array: [0] => Array ( [ID] => 1 [Name] => Name1 ) [1] => Array ( [ID] => 2 [Name] => Name2 ) [2] => Array ( [ID] => 3 [Name] => Name3 The desired output: [Key1] => Name1 [Key2] => Name2, Name3 I have the following code which works but I know this is not the right way. If anybody could let me know what would be a better way to achieve this, it