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

WBOY
Release: 2016-07-25 09:00:31
Original
872 people have browsed it
php数字格式化的例子(number_format函数应用),有需要的朋友,可以参考下。

例如,

echo number_format(285266237);
Copy after login

输出 285,266,237

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

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

echo byte_format(285266237);
?>
Copy after login

输出: 272M



source:php.cn
Statement of this Website
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]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!