开发者

Anyone knows a good implementation of file size as a value object in PHP?

In project i came across a lot of references to disk or file sizes(in bytes, kilo, mega etc) so i though this is a very g开发者_JAVA百科ood candidate for a value object like Money or Quantity. I wonder if anyone has ever done this before in php. Thanks.


You can use Zend_Measure_Binary...

$measure = new Zend_Measure_Binary($size, Zend_Measure_Binary::BYTE);
$size = $measure->convertTo(Zend_Measure_Binary::MEGABYTE);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜