I display the array structure with:
$arr = json_decode($elements,true);echo <pre>",print_r($arr,true),"</pre>";
The resulting array is below.
Array
(
[a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5] => Array
(
[0] => Array
(
[value] => Telephone Number
)
)
[e3145090-5017-44a9-bfaa-64602bacf96f] => Array
(
[0] => Array
(
[value] => Fax Number
)
)
)
I need to be able to replace the value associated with a specific identifier ie. replace the ‘Telephone Number’ with another string $newdata, as this is associated with the identifier ‘a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5’.
I am new to this, but my initial attempt was as follows.
$newdata = “ABCD”;
foreach($elements as &$value)
{
$value['a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5'] = $newdata;
}
This seems to have absolutely no effect. Can someone point me in the right direction.
Thanks, Alec


