I need to spin through an array and set content profile properties using the $key followed by [0]['value'] = $value; I keep getting errors and can't figure out how to create the property dynamically. Here is the code:
I have tried multiple variations of concatenating $key to [0]['value'] including creating variables and then inserting them in place but nothing is working. Any suggestions on what I can try would be appreciated.
Not sure if this will work (or is what you actually want):
PHP Code:
$profile->{$key}[0]['value'] = $value;
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Not sure where in the manual that is, but in general it's referred to as "complex variable notation", and is used when you need to give a "hint" to the parser as to where a given variable name begins and ends.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks