PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Luis I. Larrateguy  >  Simplifica  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: testing file
Class: Simplifica
Simplify boolean expressions
Author: By
Last change:
Date: 10 years ago
Size: 665 bytes
 

Contents

Class file image Download
<?php
require("simp.php");
function
parseVariables(&$cadena,&$vars) {

   
$cant_vars = strlen($vars);
   
   
$cadena = str_replace(" ","",$cadena); // saco espacios en blanco
   
$cadena = strtoupper($cadena); // paso a mayusculas
   
   
$reg_neg = "([~|][".$vars."])"; // Expresion regular para cambiar las negadas
   
$reg_no_neg = "([".$vars."])"; // Expresion regular para cambiar las no negadas
   
    // Reemplazos
   
$cadena = ereg_replace($reg_neg, "0", $cadena);

   
$cadena = ereg_replace($reg_no_neg, "1", $cadena);
   
$cadena = str_replace("+"," ",$cadena);
   
// all done

}

$old_cad = $cad;
parseVariables($cad, $vars);
QM($cad,$vars);




?>