Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.140.198.3
<?php
function preprocess_html($val){
define("PPD_NAME", 0);
define("PPD_VAL", 1);
//Loop until %% directives have been all found
while(($ippd = strpos($val, "%%", $ippdend)) !== false){
//Get the end of the directive
$ippdend = strpos($val, "%%", $ippd + 1) + 2;
//Get the directive
$ppd = explode("=", substr($val, $ippd + 2, $ippdend - $ippd - 4));
//Execute the directive
switch($ppd[PPD_NAME]){
case "includefile":
//Replace the directive with the content of the include
if(is_file($ppd[PPD_VAL])){
$cnt = implode("\n\r", file($ppd[PPD_VAL]));
}else{
$cnt = "";
}
break;
default:
$cnt = "";
}
//Replace the directive with the cnt
$val = str_replace("%%" . implode("=", $ppd) . "%%", $cnt, $val);
}
return $val;
}
?>
|