Jump to content

[SOLVED] Check if file pointer is valid


btherl

Recommended Posts

I found the following..

 

if (is_resource($fp) && get_resource_type($fp) === 'stream') {
  ...
}

 

But it doesn't distinguish between stream types.. to do that you need to use stream_get_meta_data() and look even deeper.  I guess that is the price of flexibility.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.