I've got the following object start code; however, right now it only uses 1 variable ( $online
) .... I need to add a second variable ( $var2
) to the code so that I can have "var2"=> $var2
under "online"=> $online
. This needs to be added to the first line of code around where use (&$online)
so the code knows the use this variable.
ob_start(function($c) use (&$online){
$replacements = array(
"online"=> $online
);
return preg_replace_callback("/{(\w+)}/",function($m) use ($replacements) {
return isset($replacements[$m[1]]) ? $replacements[$m[1]] : $m[0];
},$c);
});
How do I add this? Everything I try breaks the code completely.