欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

some useful

程序员文章站 2022-05-08 19:43:49
...
1. number_format

$number = 1234.5678;

// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57


2. ucwords

$bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!


In Perl (CGI) the function is ucfirst().
Or you can just use CSS:
[code="css]
style="text-transform:capitalize;"
[/code]

3.