php parse error, unexpected $end 的奇怪问题 描述如下:如题错误 搜了一下 可能是 语法错误 多了{}<??> 等等但是看了没有类似错误另外 删除 这段:function __destruct(){ ` mysql_close($this->conId); }后 错误就没有了是否 有什么秘密?请指教代码跟帖附上 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?phpclass connection{ public $conId = null; private $properties = array(); function __construct(){ $this->readConfig(); $db_host = $this->properties["db_host"]; $db_user = $this->properties["db_user"]; $db_password = $this->properties["db_password"]; $this->doConnection($db_host, $db_user, $db_password); } function __destruct(){ ` mysql_close($this->conId); } function doConnection($db_host, $db_user, $db_password){ $this->conId = mysql_connect($db_host, $db_user, $db_password) or die('Cannot connect to db: ' . mysql_error()); mysql_select_db($db_name,$this->conId); if($this->conId){ echo "连接成功"; }else{ echo "连接失败"; } } function readConfig(){ $file_handle = fopen("../web.config", "r"); while (!feof($file_handle)) { $line = fgets($file_handle); $tempArray = explode("=", $line); for($i = 0;$i < count($tempArray);$i++){ $temp = $tempArray[$i]; $tempArray[$i] = trim($temp); } $property = $tempArray[0]; $value = $tempArray[1]; $tempArray = array($property=>$value); $this->properties = array_merge($this->properties , $tempArray); } fclose($file_handle); }}new connection();?> ` mysql_close($this->conId);你没发现最开头有`这个字符吗?````````````````````````````````````````````````````````````````````````` 新手求助 Notice: Undefined variable: HTTP_RAW_POST_DATA in错误! 求一个PHP正则表达解法 一个小问题 关于 setcookie()函数问题! wordpress提示区域时间设置问题 一个关于window.open打开窗口的问题(十分奇怪) 关于表 数据库 菜鸟求助 mb库、gd库不安全么? 请教MYSQL_RESULT()函数! 请教宇凡--关于整个文件夹的拷贝 导入了类,凭什么不让我 new phpMyAdmin无法登录
class connection{
public $conId = null;
private $properties = array();
function __construct(){
$this->readConfig();
$db_host = $this->properties["db_host"];
$db_user = $this->properties["db_user"];
$db_password = $this->properties["db_password"];
$this->doConnection($db_host, $db_user, $db_password);
}
function __destruct(){
` mysql_close($this->conId);
}
function doConnection($db_host, $db_user, $db_password){
$this->conId = mysql_connect($db_host, $db_user, $db_password) or die('Cannot connect to db: ' . mysql_error());
mysql_select_db($db_name,$this->conId);
if($this->conId){
echo "连接成功";
}else{
echo "连接失败";
}
}
function readConfig(){
$file_handle = fopen("../web.config", "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
$tempArray = explode("=", $line);
for($i = 0;$i < count($tempArray);$i++){
$temp = $tempArray[$i];
$tempArray[$i] = trim($temp);
}
$property = $tempArray[0];
$value = $tempArray[1];
$tempArray = array($property=>$value);
$this->properties = array_merge($this->properties , $tempArray);
}
fclose($file_handle);
}
}
new connection();
?>
你没发现最开头有`这个字符吗?
`````````````````
``````````````````
```````````````````
```````````````````