I need a function that replace every variable_name inside \'{}\' with the correct variable. Something like this:
$data[\"name\"] = \"Johnny\"; $data[\"age\"
You might want to have a look at the preg_replace function.