Replace mustache placeholder using data from an associative array – PHP
How to write custom php function for replacing variable with value by passing function parameters? $template = "Hello, {{name}}!"; $data = [ 'name'=> 'world' ]; echo replace($template, $data); function replace($template, $data) { $name = $data['name']; return $template; } echo replace($template,…