I have an array which contains multiple other arrays. These arrays have a value called [note] which references a variable called $theNote which is located above/outside the array. This variable holds a simple template with a few spans.
$theNote = '<span class="icon"></span><span>Hello my name is $thename</span>';
I have an array called client_infos which contains multiple arrays inside like
'client_infos' => array (
array (
'name' => 'John smith',
'note' => $theNote,
'prepend' => '',
'append' => '',
'formatting' => 'html',
),
array (
'name' => 'Mary smith',
'note' => $theNote,
'prepend' => '',
'append' => '',
'formatting' => 'html',
),
);
There will be an unknown number of names eventually. What I need to be able to do is in my template, call $theNote in a loop or something and the following to be outputted...
<span class="icon"></span><span>Hello my name is John Smith</span>
As you can see, the [note] info in the array uses the $theNote varible, this outputs a block of code with a variable inside called $thename. I do not know how to get my [name] info.. into the $thename variable.
Basically some how get. $thename inside $theNote to = the current array [name] value.
The reason for all of this is so that I can easily update "the note" code once, without having to do it in all the child arrays.
I hope I am being clear enough, any ideas?