Advertisement
rickyc81

Untitled

May 23rd, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4.  
  5. //Copio il file
  6. //!copy("http://api.ivao.aero/getdata/whazzup/whazzup.txt", "/var/www/html/casper/whatsupp.txt");
  7.  
  8.  
  9. //apro il file
  10. $file_handle = fopen("/var/www/html/casper/whatsupp.txt", "r+");
  11.  
  12.  
  13. //leggo il file fin quando non finisce
  14. while (!feof($file_handle)) {
  15.    
  16.    
  17. //divido il file in righe ed esplodo la riga secondo il divisore ":"
  18.     $line_of_text = fgets($file_handle);
  19.     $parts = explode(':', $line_of_text);
  20.    
  21.  
  22. }
  23.  
  24.  
  25. fclose($file_handle);
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement