Witam, w jaki sposób mogę pobrać z pliku liczby przed tabem oraz sam text po tabie?
mój kod.php
header('Content-type: text/html; charset=Windows-1256');
$handle = fopen('test.txt', 'r');
$array = [];
if ($handle) {
while (($line = fgets($handle)) !== false) {
$ID = (int) filter_var($line, FILTER_SANITIZE_NUMBER_INT);
$array[$ID] = $line;
print_r($array);
}
// print_r($array);
fclose($handle);
}
test.txt
1 [tab]tutaj jest jakis text
3 [tab]tutaj kolejny text
2 [tab]tutaj kolejny text
program ma pobierać id = te liczby oraz po tabie sam text