Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $csv = fopen('upload/articles_CH_B2C.csv', 'r');
- $c = 0;
- while(($content = fgetcsv($csv, 0, '|')) != FALSE) {
- for($i = 0; $i < count($content); $i++) {
- $array = explode('=', $content[$i]);
- foreach($array as $key=>$value) {
- $items[] = $value;
- }
- }
- $final = array();
- for($i = 1; $i <= count($items); $i++) {
- if($items[$i] != '') {
- $final[$c][trim($items[$i])] = trim($items[$i+1]);
- }
- }
- echo $c.' → '.$final[$c]['secondid'].' - '.$final[$c]['gross_price'].'<br />';
- $c++;
- }
- ?>
Add Comment
Please, Sign In to add comment