Created
June 15, 2016 09:21
-
-
Save agborkowski/8fbf390fda2ed5bbee6d2f58a0954d3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$csv = file_get_contents($from); | |
$csvRows = preg_split('/[\r\n]{1,2}(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/', $csv); #split csvRows properly | |
$data = array(); | |
//domain//group//url | |
echo "Start importing data {$from}"; | |
$head = str_getcsv(array_shift($csvRows), ','); | |
print_r($head); | |
$created = date('Y-m-d'); | |
$i = 0; | |
foreach ($csvRows as $row) { | |
$i++; | |
$column = str_getcsv($row, ','); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment