split file into an array
Posted: Sat Mar 05, 2005 3:07 pm
Code: Select all
<?php
i've got a .txt file that contains values in a row separated by tabs
and columns seaparated by 3 tabs
i'm trying to split them the values into an array at the tabs
i think i'm way off here. can someone point me in the right direction.
if (isset($_FILESї'report'])) {
$file_to_be_processed = $_FILESї'report']ї'tmp_name'];
$file = file($file_to_be_processed);
$line_array = split("\t | \t\t\t", $file);
foreach($line_array as $val) {
print "$val<br>";
}
?>