3
Answers

Read and write a csv file in php

snowal raj

snowal raj

7y
332
1
Hai,
      I need to read and write from csv file ,
and i am try this but its not working
 
 

<?php
$file = fopen("C:\Users\Downloads\workorder.csv","r");

$sno=1;
while (($line = fgetcsv($file)) !== FALSE) {
//$line is an array of the csv elements
print_r($line);
}
fclose($file);


?> 
 
 
 
Answers (3)