您的位置:首页 > 其它

将1234567890----->1,234,567,890

2016-11-16 17:56 344 查看
<?php
//$contents=file_get_contents('http://news.baidu.com/');
header('Content-type:text/html;charset=utf8');
//将1234567890----->1,234,567,890
$str='1234567890';
$strArr=str_split(strrev($str),3);
//print_r($strArr);//Array ( [0] => 098 [1] => 765 [2] => 432 [3] => 1 )
echo strrev(implode(',',$strArr)).'<br />';//---->1,234,567,890
//implode把数组拼接为字符串;

?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐