Advertisement
alpa_s

Untitled

Jun 29th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. /**
  2. * @param $path
  3. * @param $delimiter string
  4. * @return array|bool
  5. */
  6. public static function getArrayFromCsv($path, $delimiter = ';')
  7. {
  8. $text = null;
  9. $handle = fopen($path, 'r');
  10. if ($handle !== false) {
  11. while (($data = fgetcsv($handle, 0, $delimiter)) !== false) {
  12. $text[] = $data;
  13. }
  14. }
  15. fclose($handle);
  16. return $text;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement