PHP Code Snippets

Read csv contents into an array
David Carr

using array_map to apply ste_getcsv to a CSV file to convert it's contents into an array.

$csv = array_map('str_getcsv', file('data.csv')); 

 



Copyright © 2011 - 2017 created by David Carr Web Developer. All code MIT license. All rights reserved. Built using Simple MVC Framework