I am looking for a construct which loop through an associative array and change the values of each of the array elements.
For example, for each element in an array I want to append some text to the value. A code example might look like this:
foreach ($link_array as $link_string) {
$link_string = "<a href=\"$link_string\" target=\"$link_string\">";
}
Obviously, this doesn't work because the assignment is to the placeholder var $link_string, not to the actual value of the array.
Since I know the keys, as a last resort I could simply make assignments using subscripts, but I should think there was a way to loop through and do it without knowing the keys.