Re: php include

From: Trap (Trapasak@volny.cz)
Date: 02. 05. 2003, 21:40 CEST

  • Next message: Trap: "Re: php include"
    On Wed, 30 Apr 2003 17:44:25 +0200 (CEST)
    Ivanek <zlutypes@seznam.cz> wrote:
    
    > > Tak to je trochu viac ako riadok, dva ;) a mas tam regularny vyraz,
    > > ktory to bude poriadne brzdit.
    > 
    > Predstav si, ze nebude. Jednoduchy linearni regex typu // a jeste k tomu
    > pouzity na kratky string je dokonce rychlejsi nez pouziti nektere stringove
    > fce, napr. strstr(). Napsal jsem si to v obou verzich a to, co jsem
    > predpokladal, se potvrdilo. Fce:
    
    > byla dokonce 1.4x rychlejsi, nezli totez se stristr():
    Tak to je samozrejme pitomost. To bych stristr musel 
    programovat snad ja :).
     
    > function myinclude($what,$incl=0){
    >    $fx=fopen($what,"r");
    >    $flg=false; $txt='';
    >    while($line=fgets($fx,8192)){
    >       if(stristr($line,'<!-- myinclude -->')){
    >          $flg=!$flg;
    >          if(!$incl)continue;
    >       }
    >    $txt.=$flg?(trim($line)."\r\n"):'';
    >    }
    >    fclose($fx);
    > return $sum;
    > }
    On totiz vyse uvedeny kod nefunguje tak jak by mel. 
    Mas prehozene parametry u stristr.
    
    
    -- 
    S pozdravem
    Trap
    

  • Next message: Trap: "Re: php include"

    This archive was generated by hypermail 2.1.6 : 02. 05. 2003, 21:43 CEST