Why do require open file and fwrite cause an error? Warning: fwrite ()
require dirname(__FILE__).'/../logs/log.php'; function addLog($var) { $file = dirname(__FILE__).'/../logs/log.php'; fwrite($file, $var); } Why do require open file and fwrite cause an error? Warning: fwrite ()
require dirname(__FILE__).'/../logs/log.php'; function addLog($var) { $file = dirname(__FILE__).'/../logs/log.php'; fwrite($file, $var); } It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
Cons because you need to start by reading the basics: http://php.net/manual/ru/function.fwrite.php
The fwrite function first parameter requires a link to the resource where the information will be written.
Forgot $ file = fopen ($ file, 'a');
Source: https://ru.stackoverflow.com/questions/730085/
All Articles