Guest User

Untitled

a guest
Sep 11th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. CSV file read fail (PHP )
  2. $row = 0;
  3. if($handle = fopen("SampleQuizData.csv","r") !== FALSE)
  4. {
  5. // WORKS UNTIL HERE, SO FILE IS BEING READ
  6. while(!feof(handle))
  7. {
  8. $line = fgetcsv($handle, 1024, ",") ;
  9. echo $line[2]; // DOES NOT WORK
  10. }
  11. }
  12.  
  13. parijat,something,parijatYkalia@hotmail.com
  14. matthew,durp, mdurpdurp@gmail.com
  15. steve,vai,stevevai@gmail.com
  16. rajni,kanth,rajnikanth@superman.com
  17.  
  18. <?php
  19.  
  20. $row = 0;
  21.  
  22. if (($handle = fopen("SampleQuizData.csv", "r")) !== FALSE)
  23.  
  24. {
  25. while(!feof($handle)){
  26. $line = fgetcsv($handle, 1024, ",") ;
  27. echo "$line[2]";
  28.  
  29. }
  30. }
  31.  
  32. ?>
  33.  
  34. while(!feof($handle)){
  35.  
  36. while(!feof(handle)){
  37.  
  38. <?php
  39. ini_set("auto_detect_line_endings", true);
  40. ?>
Add Comment
Please, Sign In to add comment