实例一:这是正确的
<?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)
?>
白板的微信
一只斗牛犬