/***/
$fp = fopen('filename.txt', 'a+');
// The correct thing to do is:
if (! $fp)
throw new Exception( 'Something went wrong opening the file' );
// Otherwise, you can also check with:
if (! is_resource($fp))
throw new Exception( 'Something went wr
On 08/26/2014 09:19 PM, Matt Pelmear wrote:
Do you check whether $fh2 is a resource after you fopen()?
Do you check whether $fh2 is a resource after you fopen()?
How?
TIA
Ethan
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.ne
Do you check whether $fh2 is a resource after you fopen()?
btw, a better way than:
$ chown ethan:ethan filename.txt
Might be:
$ chown ethan:www-data filename.txt
$ chmod 664 filename.txt
This way you own the file, the server can write to it (assuming your server
has group www-data), and it is not