1. Go to this page and download the library: Download jbboehr/php-mustache library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jbboehr / php-mustache example snippets
$mustache = new Mustache();
$tmpl = <<<EOF
Hello {{name}}
You have just won {{value}} dollars!
{{#in_ca}}
Well, {{taxed_value}} dollars, after taxes.
{{/in_ca}}
EOF;
$data = array(
'name' => 'John',
'value' => 10000,
'taxed_value' => 10000 * 0.6,
'in_ca' => true,
);
$partials = array();
echo $mustache->render($tmpl, $data, $partials);