- var_dump: documentation ( source)
- preg_match: documentation ( source)
- explode: documentation ( source)
- preg_replace: documentation ( source)
<?php
$a = array(1,2);
$query = 'found {{$_the.test}}';
$_the['test'] = 'var';
preg_match('/({{\$(.*)}})/',$query,$matches);
var_dump($matches[2]);
$parts = explode('.',$matches[2]);
var_dump(${"$parts[0]"."[[$parts[1]]"});
$new = preg_replace('/({{\$(.*)}})/',${$matches[2]},$query);
echo $new;