Keresés

Aktív témák

  • b14

    senior tag

    válasz Secretive #1 üzenetére

    Nos, egy számláló, ami egy csv listában tárolja a dátumot, amikor megnézték az oldalt az így néz ki, ebből csak egy lépés a teljess program.


    <?php

    function fputcsv($handle, $row)
    { $fd=';'; $quot='''';
    $str='';
    foreach ($row as $cell) {
    $cell=str_replace(Array($quot, ''\r\n''),
    Array($quot.$quot, ''),
    $cell);
    if (strchr($cell, $fd)!==FALSE || strchr($cell, $quot)!==FALSE) {
    $str.=$quot.$cell.$quot.$fd;
    } else {
    $str.=$cell.$fd;
    }
    }

    fputs($handle, substr($str, 0, -1).''\r\n'');

    return strlen($str);
    }
    setlocale(LC_ALL,''hu_HU'');

    $ev=strftime(''%G'',time());
    $honap=strftime(''%B'',time());
    $nap=strftime(''%d'',time());
    $lista = array($ev,$honap,$nap);
    $fp=fopen(''lista.csv'',''a'');
    //foreach ($lista as $line) {
    // fputcsv($fp,$line,'';'');
    //}
    fputcsv($fp,$lista);
    fclose($fp);

    $file=file(''lista.csv'');
    print(count($file));
    ?>

    ''...de a konfigjából kiindulva, nem hiszem, hogy 40 éves családos ember lenne...'' -- by Slax

Aktív témák