[英]PHP - Echo is not displaying correctly
https://pastebin.com/pEg8ZARP https://pastebin.com/pEg8ZARP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Future Value</title>
</head>
<body>
<?php # Script 1.8 - futureValue.php.
// Set the variables:
$interest = .08;
$amount = 1000;
$years = 20;
// Calculate the value:
$value = $amount* pow( (1+$interest), $years);
// Format the total:
$value = number_format ($value, 2);
// Print the results:
echo "<p>The future value is <b>/$$value</b>.</p>";
?>
</body>
</html>
I tried pasting it here but the formatting got messed up. 我试着在这里粘贴它,但格式搞砸了。
Whenever I try to load the page it just says " The future value is /$$value. "; 每当我尝试加载页面时,它只是说“未来值是/ $$值。”; ?> " instead of displaying "The future value is $4660.96.". ?>“而不是显示”未来的价值是4660.96美元。“
I am totally lost at what I am doing wrong. 我完全迷失在我做错的事情上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.