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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -