$smarty = new Smarty; $smarty->assign('name', 'John Doe'); $smarty->assign('age', 30); // unset the age variable $smarty->unset_var('age'); // render the template $smarty->display('index.tpl');
$mustache = new Mustache_Engine; $data = array('name' => 'John Doe', 'age' => 30); // unset the age variable unset($data['age']); // render the template echo $mustache->render('Hello {{name}}!', $data);In this example, we create a new Mustache object and define an array with two variables 'name' and 'age'. We then remove the 'age' variable from the array using `unset()` function before rendering the template using `render()` function. Package library: `Mustache`