Hi,

When i try to run the php script

<? php

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
$theData = fgets($fh);
fclose($fh);

echo $theData; 

?>

I get the error :

"Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\xampp\htdocs\readfile.php on line 3"

I can't figure out why, any help appreciated

tris

Try removing the space between <? and 'php'.

That should fix it.

Thanks!! I really appreciate your help!

tris

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.