I try to use file_get_contents form PHP but it's not working.
There is my code :
$filename = "/opt/gemel/test.txt";
if($filecontent = file_get_contents($filename)){
$nom = fgets(STDIN);
file_put_contents($filename, $nom, FILE_APPEND);
}
else
echo "fail";
And my file test.txt is empty. (0 octets). He exists but he is empty.
When i write something into it, my code works perfectly but if he is empty my code echo "fails"
Why that, why he can't open the file text.txt ?