Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array
- (
- [0] => Array
- (
- [imie;nazwisko;telefon] => 3;email@gmail.com;888438734
- )
- [1] => Array
- (
- [imie;nazwisko;telefon] => 6;email@gmail.com;500506518
- )
- [2] => Array
- (
- [imie;nazwisko;telefon] => 7;email@gmail.com;500506514
- )
- [3] => Array
- (
- [imie;nazwisko;telefon] => 16;email@gmail.com;512219888
- )
- [4] => Array
- (
- [imie;nazwisko;telefon] => 17;email@gmail.com;796688012
- )
- [5] => Array
- (
- [imie;nazwisko;telefon] => 19;email@gmail.com;507823044
- )
- [6] => Array
- (
- [imie;nazwisko;telefon] => 32;email@gmail.com;695036055
- )
- [7] => Array
- (
- [imie;nazwisko;telefon] => 39;email@gmail.com;600678649
- )
- [8] => Array
- (
- [imie;nazwisko;telefon] => 50;email@gmail.com;504430005
- )
- [9] => Array
- (
- [imie;nazwisko;telefon] => 52;email@gmail.com;606272420
- )
- [10] => Array
- (
- [imie;nazwisko;telefon] => 54;email@gmail.com;502442927
- )
- [11] => Array
- (
- [imie;nazwisko;telefon] => 720;email@gmail.com;668544084
- )
- [12] => Array
- (
- [imie;nazwisko;telefon] => 54;email@gmail.com;500506307
- )
- )
- $csv = array_map("str_getcsv", file($path,FILE_SKIP_EMPTY_LINES));
- $keys = array_shift($csv);
- foreach ($csv as $i=>$row) {
- $csv[$i] = array_combine($keys, $row);
- }
- echo '<pre>';
- print_r($csv);
- echo '</pre>';
- foreach($array as $arrIdx => $subArr){
- foreach($subArr as $keys => $values) {
- $key = explode(";", $keys);
- $value = explode(";", $values);
- for($i=0; $i <= 2; $i++){
- echo $key[$i]." : ".$value[$i];
- }
- }
- }
- $csv = array_map("str_getcsv", file($path,FILE_SKIP_EMPTY_LINES));
- $keys = explode(";", array_shift($csv));
- foreach ($csv as $i=>$row) {
- $csv[$i] = array();
- foreach (explode(";", $row) as $j => $element) {
- $csv[$i][$keys[$j]] = $element;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement