<?php
$session = "summertime";
print "<p>I love the $season.</p>";
?>
print这个函数总是返回1
2.echo
<?php
$heavyweight = "Lennox Lewis";
$lightweight = "Floyd Mayweather";`这里写代码片`
echo $heavyweight," and ",$lightweight," are great fights.";
?>
echo没有返回值 void
3.printf
printf(“Bar %d.”,100);
printf(“%d bottles of tonic water cost $%f”,100,43.20);
4.sprintf
sprintf()函数的功能与printf()相同,但它将输出赋给一个字符串,而不是直接呈现到浏览器
$cost = sprintf("$.2f",43.2); //$cost = $43.20