Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过这个:
$number = 11223344556677; echo number_format($number,2,'/',2,'/','');
但没有得到结果。请帮忙。
好吧,number_format不是为了这样做。您可以通过多种方式自己完成,例如:
number_format
echo preg_replace('/^(\d*)(\d{2})(\d{2})$/', '$1/$2/$3', $number);
像这样的东西?
$formatted_number = preg_replace('(\d+?)(\d\d)(\d\d)','$1/$2/$3',$number);