demo_func_var_is_resource.php:
<!DOCTYPE html> <html> <body> <?php $file = fopen("test.txt","r"); if (is_resource($file)) { echo "File is open"; } else { echo "Error open file"; } ?> </body> </html>