fwrite error

Posted on 16th Feb 2014 by admin

Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$errorLog_FilePath = "error_log.txt";
$handle = @fopen($errorLog_FilePath,'a+');
$strError = "hi!";
if(!fwrite($handle, $strError)){ //this is line 5
echo('Cannot write to file');
}
?>
I get:
Parse error: syntax error, unexpected T_VARIABLE on line 5

I can't understand what is wrong with it.

Other forums