实例一:这是正确的
<?php
$num = 5;
$location = 'tree';
$format = 'The %2$s contains %1$d monkeys';
echo sprintf($format, $num, $location)
?>
实例二:为什么这是错误的
<?php
$num = 5;
$location = 'tree';
$format = "The %2$s contains %1$d monkeys";
echo sprintf($format, $num, $location)
?>
- 4 回答
- 0 关注
- 452 浏览
添加回答
举报
0/150
提交
取消