I need a function that replace every variable_name inside '{}' with the correct variable. Something like this:
$data["name"] = "Johnny";
$data["age"] = "20";
$string = "Hello my name is {name} and I'm {age} years old.";
$output = replace($string, $data);
echo $output;
//outputs: Hello my name is Johnny and I'm 20 years old.
I know there are framework/engines for this, but I don't want to have to install a bunch of files just for this.