drsxobip501258 2016-01-06 10:00
浏览 345
已采纳

如何用PHP将十进制整数转换为字节?

I need to get how much bytes is a decimal integer with php. For example how can I know if 256,379 is 3-bytes with php? I need a php function to pass 256,379 as input and get 3 as output. How can I have it?

  • 写回答

2条回答 默认 最新

  • dongpuchao1680 2016-01-06 10:12
    关注

    You need calculate logarithm like this:

    echo ceil( log ($nmber, 256) );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?