简单教程
提交运行
代码编辑器:
<?php $number = 123; $str = "With 2 decimals: %1$.2f<br>With no decimals: %1$number"; $txt = vsprintf($str,array($number)); echo $txt;
运行结果: