fgets()-error
-
Hello,
First of all, thank you for the plugin WPCode Lite!
I am asking for help with the following problem. The PHP code below does not work:
$fp = fopen(“current/yesterday.txt”, “r+”); //contains numeric value like 123456789123
$yesterday = fgets($fp, 9);
echo “$yesterday”;
I get the following error message (which I don’t know what to do with):
“Snippet not activated, the following error was encountered: fgets(): Argument #1 ($stream) must be of type resource, bool given“
I have already used this code in a previously created snippet and this snippet still works fine. However, if I try to create a new snippet with the same code, I get the above error message.
Can it be because I have meanwhile increased the PHP version to 8.0.28? And if so, what to do? (I’m using WP 6.1.1)
Thanks and best regards
MattaThe page I need help with: [log in to see the link]
- The topic ‘fgets()-error’ is closed to new replies.