So i need to first open a directory, which I did and it works, after I need to make the files called "." and ".." to not be displayed, which I did and it works as well but after all of this I need to open every file from that directory (except for that "." and "..") and display it's content.

My code is here:

```
<?php
    $handle = opendir('data');
    $files = array();
    while (false !== ($file = readdir($handle))) {
        if ($file!=="." && $file!=="..") {
            $files = $file;
            print_r ('<p>' . ucfirst($files) .'</p>');
        }
        foreach($files as $dataz) {
            $handle2 = fopen('data/'.$dataz, 'r');
            while (!feof($handle2)) {
                $name = fgets($handle2);
                echo '<p>' . $name .'</p>';
            }
            fclose($handle2);
        }

    }
    closedir($handle);
?>

```

The error that i get is:
Warning: Invalid argument supplied for foreach() in /home/something/something/websitephp/weather.php on line 30 Call Stack: 0.0025 325952 1. {main}() /home/something/something/websitephp/weather.php:0

I think the error will be $dataz but i need that in order to indicate to the fopen what files should open.