sdemirkeser adlı üyeden alıntı: mesajı görüntüle
hocam ilgili sayfada yorumlar kismina inerseniz filesize2bytes diye bir fonksiyon göreceksiniz. o direk işinizi görebilir
Ben php de acemiyim şimdi burada ben dosyanın ismini nerde belirticeğim?
Ya da nasıl fonkisyona ataya bilirim?

şöle yaptım fakat 0 aldım
<?php
/**
 * Converts human readable file size (e.g. 10 MB, 200.20 GB) into bytes.
 *
 * @param string $str
 * @return int the result is in bytes
 * @author Svetoslav Marinov
 * @author http://slavi.biz
 */
function filesize2bytes($str) {
    $bytes = 0;

    $bytes_array = array(
        'B' => 1,
        'KB' => 1024,
        'MB' => 1024 * 1024,
        'GB' => 1024 * 1024 * 1024,
        'TB' => 1024 * 1024 * 1024 * 1024,
        'PB' => 1024 * 1024 * 1024 * 1024 * 1024,
    );

    $bytes = floatval($str);

    if (preg_match('#([KMGTP]?B)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) {
        $bytes *= $bytes_array[$matches[1]];
    }

    $bytes = intval(round($bytes, 2));

    return $bytes;
}

// c?kt?s?:
// somefile.txt: 1024 bytes

$filename = 'errors/001.mp3';
echo $filename . ': ' . filesize2bytes($filename) . ' bytes';


?>
echo $filename . ': ' . filesize($filename) . ' bytes';
bu kodu
echo $filename . ': ' . filesize($filename)/1024 . ' KBytes';
olarak yazıyorum
fakat bölme işlemi yapılan zaman mesela 664.055664063 böyle uzun bir rakam çıkıyor.
Noktadan sonrasını sile bilirmiyiz?
Yoksa uzun bir kodmu gerekir bu zaman?