-1

我试过这个:

$number = 11223344556677;
echo number_format($number,2,'/',2,'/','');

但没有得到结果。请帮忙。

4

2 回答 2

3

好吧,number_format不是为了这样做。您可以通过多种方式自己完成,例如:

echo preg_replace('/^(\d*)(\d{2})(\d{2})$/', '$1/$2/$3', $number);
于 2012-11-28T14:05:16.030 回答
2

像这样的东西?

$formatted_number = preg_replace('(\d+?)(\d\d)(\d\d)','$1/$2/$3',$number);
于 2012-11-28T14:05:30.653 回答