Ben bir dizinde TextFiles değerleri çekmek ve dizilerin içine değerlerin bu listeleri koymak istiyorum.
Ben nesne "gibi" mysql sonucu setine bu dizileri düzenlemek ancak nasıl emin değilim.
İşte ben bugüne kadar ne var:
// Retrieve all files names, create an array
$dir = './textfiles/';
$files1 = glob($dir . '*' . '.txt');
foreach ($files1 as $filename)
{
$file_array[] = basename($filename);
}
//use the file function to create arrays from the text files
$filepath = $dir . $file_array[0];
$text_array = file($filepath);
The code above only retrieves the information from 1 text file. How can I retrieve the other values into additional arrays?
Secondly once all the arrays are retrieved, how can a make the object?
Thirdly, how can I make this a function to accomodate newly created textfiles?