Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param $path
- * @param $delimiter string
- * @return array|bool
- */
- public static function getArrayFromCsv($path, $delimiter = ';')
- {
- $text = null;
- $handle = fopen($path, 'r');
- if ($handle !== false) {
- while (($data = fgetcsv($handle, 0, $delimiter)) !== false) {
- $text[] = $data;
- }
- }
- fclose($handle);
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement