php不知错在哪里?

来源:百度知道 编辑:UC知道 时间:2024/05/05 02:35:16
Parse error: parse error, unexpected $end in F:\Web\APMServ5.2.0\www\htdocs\upload.php on line 61

代码中没有$end这个变量,也没有61行那么多,但就是报错~

//////////////////////////////
//upload.php代码如下
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件系统</title>
</head>

<body>
<?php
require('config.php');
function fileext($filename)
{
return substr(strrchr($filename, '.'), 1);
}

出现这种情况并不是因为$end变量引起的,而是你的括号不匹配引起的

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件系统</title>
</head>

<body>
<?php
require('config.php');
function fileext($filename)
{
return substr(strrchr($filename, '.'), 1);
}

function random($length)
{
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars) - 1;
m