ACC SHELL

Path : /srv/www/vhosts/eqnxde/lib/
File Upload :
Current File : /srv/www/vhosts/eqnxde/lib/class.reex.php

<?php

/* Chtělo by to přepsat bez eregi, ale tady stejně upgrade na vyšší PHPko 
 * nepůjde kvůli tomu, že by přestalo fungovat milion jiných věcí, tak to nechám
 * tak jako to bylo staženo z 
 * http://interval.cz/clanky/vyhledavani-v-textu-pomoci-regularnich-vyrazu/
 */

class cReex 
{ 
var $RE; //celkov� RE 
var $Text; //prohled�van� text 
var $arFound; //nalezen� �daje 

function cReex($InpText, $RegExp) 
{ 
    $this->RE="(".$RegExp.")(.*)$"; 
    $this->Text=$InpText; 
    $this->arFound=array(); 

    while(eregi($this->RE,$this->Text,$regs)) 
    { 
        array_push($this->arFound,$regs[1]); 
        $this->Text=$regs[2]; 
    }; 
} 

function eUnique() 
{ 
    $this->arFound=array_unique($this->arFound); 
} 

function eLower() 
{ 
    foreach($this->arFound as $key=>$value) 
    { 
        $this->arFound[$key]=strtolower($this->arFound[$key]); 
    } 
} 

function eSort($sort_function="sort") 
{ 
    if (!function_exists($sort_function)) $sort_function="sort"; 
    $sort_function($this->arFound);  
} 

function ePrint($delim="\n") 
{ 
    echo implode($delim,$this->arFound); 
} 
}

?>

ACC SHELL 2018