会替换%及其后一个实体字符;
$str1 = ' There are %u million cars in %s ' ;
$number = 2 ;$str = " Shanghai " ;
$txt = sprintf( $str1, $number, $str ) ;
echo $txt;
//输出 There are 2 million cars in Shanghai
会替换%及其后一个实体字符;
$str1 = ' There are %u million cars in %s ' ;
$number = 2 ;echo $txt;
//输出 There are 2 million cars in Shanghai