Array
(
[0] => Array
(
[name] => Content-Type
[content] => some content type
)
[1] => Array
(
[name] => Content-Transfer-Encoding
[content] => some content transfer encoding
)
[2] => Array
(
[name] => Content-Encoding
[content] => some content encoding
)
)
So, I can easily push new associations onto the array:
array_push('name' => 'Content-SuperDuper-Encoding', 'content' => 'some content super duper encoding');
But, what if I want to update an existing key?
I can't seem to come across the right code. This is what I've tried, and is NOT working:
Code: Select all
foreach ($headers as $header) {
if ($headerї'name'] == $name) {
$headerї'content'] = $content;
}
}