Раскрашеный текст Скачать Распечатать Редактировать
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require_once 'libs/DudeTpl.php';

header("Content-type: text/html; charset=utf-8");

$start = microtime(true);
$tpl = new DudeTpl(true);

$tpl->add_function("strlen",create_function('$x','return "А ВОТ ХУЙ ВАМ!";'));
$tpl->add_block_function('hash',"dude_hash_test");
$tpl->items = array("10", "20", "ахуеть!<>");

echo $tpl->fetch("index",true);
echo "<b>Generation time &mdash; ".(microtime(true)-$start)."</b>";

function dude_hash_test($tpl,$repeat,$content,$algo,$salt)
{
    if(!$repeat)
    {
        return;
    }

    return $algo($content.$salt);
}