I have an array that looks like this:
array(5) {
[0]=>
array(2) {
["id"]=>
string(2) "23"
["my_value"]=>
NULL
}
[1]=>
array(2) {
["id"]=>
string(2) "62"
["my_value"]=>
NULL
}
...
I would like to have an array that as keys have the value of the key "id" in each array and as value have the value of "my_value". However if "my_value" is NULL I want to set a value of 100.
So, the result array would be like this:
array(5) {
[23] => 100
[62] => 100
...
How can I do that cleanly? I have been iterating over with a foreach but I believe it can be done cleaner...