I am using a basic file read write function in a middle ware of slim framework 3.
$file = __DIR__ . '\\result.json';
$fh = fopen($file, 'w') or die('Cannot open files: '.$file);
this file exist and path is correct. I also have the permission to read and write the file.
The result is showing cannot open files.
Please suggest how a simple read and write function will work in slim framework 3.