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);你没发现最开头有`这个字符吗?````````````````````````````````````````````````````````````````````````` php读取pdf或者doc 用手机输入后出现乱码 上传图片,截图,上传头像的问题 pHP ob_start 乱码 我的phpmyadmin这样提示,有关系吗. Cookie出现乱码? 新手问题 关于Smarty的字符串强制类型转换!! 马上给分 谁有留言簿源代码,发个给我吧 求数组中的对应关系 请问PHP和C在Linux中的开发如何结合? 导入了类,凭什么不让我 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();
?>
你没发现最开头有`这个字符吗?
`````````````````
``````````````````
```````````````````
```````````````````