PHP Classes

File: test.php

Recommend this page to a friend!
  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: 17 years ago
Size: 665 bytes


Class file image Download
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);


For more information send a message to info at phpclasses dot org.