PHP 字符串格式化函数
函数列表:ul licodeconvert_cyr_string()/code/li licodecrc32()/code/li licodehebrev()/code/li licodehebrevc()/code/li licodemoney_format()/code/li licodenumber_format()/codebr / /li /ul
函数列表:
convert_cyr_string()
crc32()
hebrev()
hebrevc()
money_format()
number_format()
echo convert_cyr_string('The string', 'k','i');
2. [代码]crc32() 跳至 [1] [2] [3] [4] [5] [全屏预览]
$checksum = crc32("This is the string."); printf("%u\n", $checksum);
3. [代码]hebrevc() 跳至 [1] [2] [3] [4] [5] [全屏预览]
//hebrevc() 函数把希伯来文本从右至左的流转换为左至右的流。它也会把新行 (\n) 转换为 <br />。 //只有 224 至 251 之间的 ASCII 字符,以及标点符号受到影响。 string hebrevc ( string $hebrew_text [, int $max_chars_per_line = 0 ] )
4. [代码]money_format() 跳至 [1] [2] [3] [4] [5] [全屏预览]
$number = 9999.89; setlocale(LC_MONETARY, 'en_US'); echo money_format('%i', $number); // Output : USD 9,999.89
5. [代码]number_format() 跳至 [1] [2] [3] [4] [5] [全屏预览]
$number = 9996.89; echo number_format($number); # Output : 9,997 echo number_format($number, 2, ',', ' '); # Output : 9 996,89
- 上一篇:facebook的代码
- 下一篇:php 文件缓存
精彩图集
精彩文章