we are generating php variable name directly linked with mysql rows output. here it is
now we have dynamic variable and we are doing base64 encoding of images
${'attachment_base64'.$row['id']} = base64_encode(file_get_contents($some_url));
now we want to pass this dynamically generated variable in while loop
$image_part .= 'array(
"name" => "'.$name.'",
"data" => "$attachment_base64"
),';
but we are unable to pass dybanic name in data.
this part should be like this
"data" => "$attachment_base641556588"
where 1556588 was dynamic id from database.
we cant use '.$row['id'].' as it will just append the data to base64 encoded data we want dynamic variable name to pass here
want to pass dynamic name in my array data part otherwise when i use this data after loop same image is passed in data part
generating this type of array from while loop data
array(
"name" => "ggggf",
"data" => "$attachment_base64",
),
array(
"name" => "6800164880433",
"data" => "$attachment_base64",
),
array()?