List and Read file . txt in PHP and take specific values separated by folders

Asked

Viewed 485 times

1

Hello, I would like a GREAT help from you. rsrs what I need to basically, is to create a system that returns to me the $variáveis separately, to print later, the values of the file Thema.txt As for example the WP..
In a. PHP file, which would be outside the THEMAS folder, it would return the themes separated by the folders, and their information in the Thema.php file

inserir a descrição da imagem aqui

The current code I’m in is this:

<?php
    // atribuição a variável $dir
    $dir = new DirectoryIterator( './themes/' );

    // atribui o valor de $dir para $file em loop
    foreach($dir as $file ) {
        // verifica se o valor de $file é diferente de '.' ou '..'
        // e é um diretório (isDir)
        if (!$file->isDot() && $file->isDir()) { 
            // atribuição a variável $dname
            $dname = $file->getFilename();

            // imprime o nome do diretório
            echo $dname."<br>";
        }
    }
?>

But it just gives me the names of the folders. I need to get back the information inside the files located in the listed folders.

  • Already tried something, could provide the code?

  • I just answered a question with a similar idea: http://answall.com/questions/177327/php-listar-os-arquivos-em-um-diret%C3%b3rio/177329#177329. See if this solution helps you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.