【php开源代码栏目提醒】:以下是网学会员为您推荐的php开源代码-print.php,希望本篇文章对您学习有所帮助。
<html>
<head>
<title>字符串函数应用</title>
</head>
<body>
<h2>打印输出函数的应用</h2>
<?php
$amount = sprintf("%01.1f", "55.35");
$who="my";
$str1="There are %s in %s poket.";
$str2="There are %d in %s poket.";
$str3="There are %f in %s poket.";
$str4="There are %b in %s poket.";
printf($str1, $amount, $who);
printf("<br>");
printf($str2, $amount, $who);
printf("<br>");
printf($str3, $amount, $who);
printf("<br>");
printf($str4, $amount, $who);
?>
</body>
</html>