Advertisement
oxx93

Untitled

Aug 4th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5. <meta charset="windows-1251">
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. $fp = fopen("http://gapi.ereality.ru/ores1.txt", "r");
  11. $clanId;
  12. if ($fp) {
  13.     while(!feof($fp)) {
  14.         $line = fgets($fp, 999);
  15.         $line = trim($line);
  16.         if (!strlen($line)) {
  17.             break;
  18.         }
  19.     if ($line[0] != '#') {
  20.             list($clanId, $clan, $nameMine, $number) = explode("|", $line);
  21.         if(!isset($data[$clanId])) {
  22.             $data[$clanId]= [
  23.                 'clanId'=>$clanId,
  24.         'clanName'=>$clan,
  25.         'mineName'=>$nameMine,
  26.         'resNumber'=>$number
  27.             ];
  28.             } else {
  29.             /* проблема тут, начиная с меди, я незнаю как добавлять
  30.         ключ в масив автоматически для ресурса или мне сменить в 19
  31.         строке код, чтоб слепить себе масив из ресурсов, тогда можна           будет чтото слепить, как-то так*/
  32.         }
  33.         }
  34.     }
  35. }
  36. ?>
  37. </body>
  38.  
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement