为什么说“解析错误:语法错误,意外'打印'(T_PRINT)......”?
<?php
//init
$pi = 3.14;
$radius = 15;
$theArea = 0;
//area = 2 pi R
$theArea = $pi * ($radius * $radius)
//output
print ("The area of a circle of radius ".$radius." is " . $theArea);
?>
答案 0 :(得分:0)
您忘记在print
//area = 2 pi R
$theArea = $pi * ($radius * $radius); //here
此外,您可以使用print
而不使用括号,因为它是一种语言结构。
print "The area of a circle of radius " . $radius . " is " . $theArea;
除非你真的想要