csv - Using str_getcsv in php -
whenever try use str_getcsv in php code returns no arrays , opens page 500 error. doing wrong?
$csvfile = "master1.csv"; $input = file_get_contents($csvfile); echo $input; array str_getcsv ( string $input [, string $delimiter = "," [, string $enclosure = '"' [, string $escape = "\\" ]]] )
the string
word telling next variable enter has string, , [
, ]
telling argument optional.
this should work;
$csvfile = "master1.csv"; $input = file_get_contents($csvfile); echo $input; $myarray = str_getcsv($input);
to result:
print_r($myarray);
Comments
Post a Comment