I'm converting MySQL data from one system to another, and the database structure is not quite the same. One database field contains multiple parameters in a format like this:
option1=value1
option2=value2
option3=value3
Yes, it is a text field with line breaks. I need to get the data (using PHP) from the one field and make variables out of it. For example, I need "option1=value1" converted to a variable $option1 that contains the value "value1".
I have pulled the data of this field into an array and tried imploding that data into a string that I could make variables from... but have had no luck. Either I wasn't doing it right or that's not the right direction to go.
I was trying something like this:
$string = implode("&",$array);
echo $string;
...but I just get a bunch of "Notice: Array to string conversion" messages along with an echo of "&Array" over and over. Help appreciated!
UPDATE: For further explanation, I've realized that I need a two level array with the user ID (pulled from the same table as the option values noted above) in one array... then each of those IDs having a nested array containing the option values.