Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. $open_file=fopen("data.txt", "r");
  4.  
  5. $key=0;
  6. $data=array();
  7.  
  8. while(!feof($open_file))
  9. {
  10. $key++;
  11. $read_file=fgets($open_file);
  12. $split_file=explode("#", $read_file);
  13.  
  14.  
  15. $data[$key] = array($split_file[1], $split_file[2], $split_file[3]);
  16. }
  17.  
  18. /*******************************************/
  19. for($x=1;$x<=3;$x++){
  20. for($i=0;$i<3;$i++){
  21. echo $data[$x][$i]; echo " ";
  22. }
  23. echo "<br>";
  24. }
  25.  
  26. unset($data["1"]);
  27. echo $data["2"][0];
  28. /*********************************************/
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement