PHP가 처음이므로 PHP 파일을 실행할 때 다음과 같은 PHP 오류가 발생합니다. 는 약간의 도움이 많이 주시면 감사하겠습니다, 감사 매우 사전에 여기 파일을 실행할 때 PHP 구문 오류가 발생했습니다.
내 코드입니다 :Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\facebook\arrays.php on line 21
<html>
<head>
<title> An empty html page </title>
</head>
<body>
<!-- this is an html comment -->
<!-- currently the body is empty -->
<?php
echo "<p>hello world</p>";
$name = "Peter Pan";
$address = "Neverland";
$age = "14.75";
$unnamed_lost_boys = array(4.5, 6, 7, 5.5, 5.25, 4, 7, 6.75);
$named_lost_boys = array("Tootles"=> 4.5,
"Nibs"=>6,
"Slightly"=>7.5);
echo "The age of Nibs is $named_lost_boys['Nibs']";
function print_details ($name, $age, $address)
{
echo "My name is $name, I'm from $address and I'm $age years old";
echo "<br>";
echo 'My name is '.$name.",I'm from ".$address." and I'm $age years old";
echo "<br>";
}
print_details($name, $age, $address);
?>
</body>
</html>
최고 .... 감사합니다 – Hollywood