Example #1
0
say("Hi..." . $myInput, DEBUG_MODE);
if (strlen($myInput) < USEFUL_STRING) {
    die("Input string " . $myInput . " too short");
}
$myAction = substr($myInput, NO_OF_QUESTIONS, 1);
$myReplyT = substr($myInput, NO_OF_QUESTIONS + 1, 1);
switch ($myAction) {
    case 0:
        // do nothing
        say("do nothing", DEBUG_MODE);
        process_reply_action($myAction, $myReplyT);
        break;
    case 1:
        // clean
        say("clean", DEBUG_MODE);
        xclean();
        process_reply_action($myAction, $myReplyT);
        break;
    case 2:
        // add
        say("add", DEBUG_MODE);
        xadd($myInput);
        process_reply_action($myAction, $myReplyT);
        break;
    default:
        say("wrong call", DEBUG_MODE);
        die("Bad data input for action");
}
function say($str, $debugLevel)
{
    if ($debugLevel) {
Example #2
0
function xeval($code)
{
    $code = xclean($code);
    @ob_start();
    @eval($code);
    $buff = @ob_get_contents();
    @ob_end_clean();
    return $buff;
}
Example #3
0
function makexprettydisp($exp)
{
    if (is_array($exp)) {
        for ($i = 0; $i < count($exp); $i++) {
            $exp[$i] = "`" . xclean($exp[$i]) . "`";
        }
    } else {
        $exp = "`" . xclean($exp) . "`";
    }
    return $exp;
}