Php reads and outputs the csc file. Php reads the csc file and outputs this article to share with you how php reads and outputs the csc file. Method 1 uses the fgetcsv function and method 2 uses the fopen function, if you need php, read and output the csc file.
This article will share with you the methods for php to read and output the csc file. Method 1 uses the fgetcsv function and method 2 uses the fopen function. if you need it, refer to it.
Method 1:
?
1 2 3 4 5 6 7 8 9 10 11 12 |
$ Row = 0; $ J = 1; // Linea por la que quieres empezar $ File = "name.txt"; // Nombre del fichero If ($ handle = fopen ($ file, "r "))! = FALSE ){ While ($ data = fgetcsv ($ handle ,","))! = FALSE ){ Print_r ($ data ); $ J ++; $ Row ++; } } ?> |
Method 2:
?
1 2 3 4 |
$ Fh = fopen ("contacts.csv", "r "); While ($ line = fgetcsv ($ fh, 1000 ,",")){ Echo "Contact: {$ line [1]}"; } |
The above is all the content of this article. I hope you will like it.
In this article, I will share with you the method for php to read and output the csc file. Method 1 uses the fgetcsv function and method 2 uses the fopen function. a small partner is required...