commit | author | age | ||
8bd4d9 | 1 | <?php |
JK | 2 | $bash = fopen('text.txt', 'r'); |
3 | $cytaty = array(); | |
4 | ||
5 | while(!feof($bash)) { | |
6 | $cytat = trim(fgets($bash)); | |
7 | if(empty($cytat)) continue; | |
8 | var_dump($cytat); | |
9 | $cytaty[(int)substr($cytat, 1)] = ftell($bash); | |
10 | while(!feof($bash) && trim(fgets($bash))!='%'); | |
11 | } | |
12 | ||
13 | fclose($bash); | |
14 | ||
15 | ksort($cytaty); | |
16 | var_dump(count($cytaty)); | |
17 | ||
18 | file_put_contents('index.txt', serialize($cytaty)); | |
19 | ?> |