Exemplo n.º 1
0
 public function parse()
 {
     $regex = "/(^[a-z])(([0-9]+|[a-z]+|\\b)+)/i";
     $membres = explode("=", $this->equation);
     $variable = $membres[0];
     $this->inconnue = $variable;
     $this->expression = $membres[1];
     $this->variables[$variable]['expression'] = $this->expression;
     //DUMMY CONTENT
     $this->variables[$variable]['min'] = 1;
     $this->variables[$variable]['max'] = 100;
     $this->variables[$variable]['pas'] = 10;
     $this->identify_blocs($this->expression);
     $this->find_vars();
     foreach ($this->variables as $var => $array) {
         if (is_null($array['expression'])) {
             $this->variables[$var]['expression'] = clean_spaces($this->resolve_expression($var, $this->blocs, $this->inconnue));
             //DUMMY CONTENT
             $this->variables[$var]['min'] = 1;
             $this->variables[$var]['max'] = 100;
             $this->variables[$var]['pas'] = 10;
         }
     }
     return $this;
 }
Exemplo n.º 2
0
Arquivo: tri.php Projeto: philum/cms
function pre_clean($ret)
{
    $ret = clean_spaces($ret);
    $ret = clean_acc($ret);
    $ret = stupid_acc($ret);
    //$ret=html_entity_decode_b($ret);//create pb
    //$ret=html_entity_decode($ret);
    $r = array('b', 'i', 'em', 'strong', 'p');
    for ($i = 0; $i < 4; $i++) {
        $ret = str_replace('<' . $r[$i] . '> </' . $r[$i] . '>', '', $ret);
        $ret = str_replace('</' . $r[$i] . '><' . $r[$i] . '>', '', $ret);
        $ret = str_replace('</' . $r[$i] . '> <' . $r[$i] . '>', ' ', $ret);
        $ret = str_replace('</' . $r[$i] . '>' . "\n" . '<' . $r[$i] . '>', "\n", $ret);
        $ret = str_replace('</' . $r[$i] . '>' . "\n\n" . '<' . $r[$i] . '>', "\n\n", $ret);
    }
    if (substr_count($ret, "]") != substr_count($ret, "[")) {
        $ret = str_replace(array("[", "]"), array("(", ")"), $ret);
    }
    //
    //$reb=htmlspecialchars($reb);
    return $ret;
}