Home  >  Article  >  Backend Development  >  php数字格式化的例子(number_format函数应用)

php数字格式化的例子(number_format函数应用)

WBOY
WBOYOriginal
2016-07-25 09:00:31879browse
php数字格式化的例子(number_format函数应用),有需要的朋友,可以参考下。

例如,

echo number_format(285266237);

输出 285,266,237

如果需要用number_format()函数格式化文件字节大小,可以参考如下的方法。

1024)
{
$value /= 1024;
$i++;
}
$return_str = round($value, $dec).$prefix_arr[$i];
return $return_str;
}

echo byte_format(285266237);
?>

输出: 272M



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]