Thema: NFO Problem
Einzelnen Beitrag anzeigen
Alt 03.04.2011, 16:10   #29
tantetoni2
König
Punkte: 116.452, Level: 100 Punkte: 116.452, Level: 100 Punkte: 116.452, Level: 100
Levelaufstieg: 0% Levelaufstieg: 0% Levelaufstieg: 0%
Aktivität: 0% Aktivität: 0% Aktivität: 0%
Letzte Erfolge
Auszeichnungen
Artikel Benutzer besitzt 1x Hilfe Level 3
 
Benutzerbild von tantetoni2
 
Registriert seit: 15.10.2008
Beitr?ge: 1.923
Abgegebene Danke: 23
Erhielt 571 Danke für 38 Beiträge
Downloads: 8
Uploads: 0
Nachrichten: 4155
Renommee-Modifikator:
7257 tantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehen
Standard

ich rede doch nicht alles schlecht, deine idee mit dem like was zb astrein, auch wenns nicht besonders abgesichert war, aber wenn du zb 20 erweiterungen in dem array hast ist es langsamer als das preg_match beispiel
PHP-Code:
function microtime_float() {
   list(
$usec$sec) = explode(" "microtime());
   return ((float)
$usec + (float)$sec);
}

$ext end(explode("."strtolower('abcs.shtml')));
$s   microtime_float();

for ( 
$i 0$i 2000; ++$i ) {
    if( 
in_array(  $ex, array('htm','html','shtm','shtml''txt''doc','zip','rar','rtf''php') ) )
       continue;
}
echo 
'<br /><br />in_array: ' . (microtime_float()-$s);

$ext strrchr 'abcs.shtml''.' );
$s   microtime_float();

for ( 
$i 0$i 2000; ++$i ) {
    if( 
preg_match'/s?html?|txt|doc|zip|rar|rtf|php/i' ,$ext ) ) 
        continue;
}
echo 
'<br /><br />preg_match: ' . (microtime_float()-$s); 
die masse machts

Ge?ndert von tantetoni2 (03.04.2011 um 16:16 Uhr)
tantetoni2 ist offline   Mit Zitat antworten Nach oben