Hi want to ask if there is a way to do this without foreach ($array as $k=>$v). I know it will work but I’m looking for a more elegant way if you know.
So my array was like:
1 = 231
2 = 432
3 = 324
I flipped it and it became: 231 => 1, 432 =>2, 324 => 3. Now what I need to do is to set all values to '1'
You can use
array_fill_keys: