12
09

Funzione che converte bytes in stringa in php

postato da Administrator, in php, tutorials.

function bytes2str($bytes)
{
        $bytes=floor($bytes);
        if ($bytes > 536870912)
                $str = sprintf("%5.2f GBs", $bytes/1073741824);
        else if ($bytes > 524288)
                $str = sprintf("%5.2f MBs", $bytes/1048576);
        else
                $str = sprintf("%5.2f KBs", $bytes/1024);
        return $str;
}

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Reddit
  • scuttle
  • Smarking
  • Spurl
  • YahooMyWeb
  • DZone
  • Internetmedia
  • Snap2r
  • Technorati

Letto:410 volte

Correlati

    No related posts

Leave a Reply

web tracker