“解析错误:语法错误,意外的T_VARIABLE".

问题描述:

这是我的代码:

 <? php
     $content = file_get_contents("http://aux.iconpedia.net/uploads/1337412470.png");
     $fp = fopen("/test/image.jpg", "w");
     fwrite($fp, $content);
     fclose($fp);
 ?>

这是我得到的错误:

解析错误:语法错误,第2行D:\ Host \ 5164 \ html \ maffick1 \ test \ download.php中出现意外的T_VARIABLE

Parse error: syntax error, unexpected T_VARIABLE in D:\Host\5164\html\maffick1\test\download.php on line 2

据我所知,当您错过分号或方括号时会出现此错误.但是我已经尝试了一切.

As far as I know, this error comes when you miss a semicolon or bracket. But I have tried everything.

在第一行中删除问号和"php"之间的空间:

Remove space between question mark and "php" in first line:

<? php

将此更改为:

<?php