How to add to a Multidimensional Array?

Hey guys,

I want to add 5 items to the end of this multidimensional array but I’m not sure what the numbers mean.

$map = array(
		'product_id' 		=> array(0,0),
		'name'				=> array(1,0),
		'model'				=> array(2,0),
		'meta_description' 	=> array(1,2),
		'meta_keyword' 		=> array(1,3),
		'meta_title' 		=> array(17,0),
		'description' 		=> array(16,0),
		'tag'				=> array(1,4),
		'sku'				=> array(3,0),
		'upc'				=> array(1,6),
		'ean'				=> array(1,7),
		'jan'				=> array(1,8),
		'isbn'				=> array(1,9),
		'mpn'				=> array(1,10),
		'location'			=> array(1,11),
		'price'				=> array(14,0),
		'tax_class'			=> array(1,12),
		'quantity'			=> array(13,0),
		'minimum'			=> array(1,13),
		'subtract'			=> array(1,14),
		'stock_status'		=> array(1,15),
		'shipping'			=> array(1,16),
		'keyword'			=> array(1,17),
		'image'				=> array(6,0),
		'date_available'	=> array(1,18),
		'length'			=> array(7,0),
		'width'				=> array(8,0),
		'height'			=> array(9,0),
		'length_class'		=> array(1,19),
		'weight'			=> array(10,0),
		'weight_class'		=> array(1,20),
		'status'			=> array(5,0),
		'sort_order'		=> array(1,21),
		'manufacturer'		=> array(11,0),
		'categories'		=> array(4,0),
		'stores'			=> array(12,0),
		'downloads'			=> array(1,23),
		'filters'			=> array(1,24),
		'recurrings'		=> array(1,25),
		'related'			=> array(15,0),
		'attribute'			=> array(4,1),
		'option'			=> array(4,3),
		'discount'			=> array(4,9),
		'special'			=> array(4,15),
		'product_image'	=> array(4,20),
		'points'			=> array(4,23),
		'reward_points'	=> array(5,22),
		'design'			=> array(4,24),
	);

Extra Items I would like to add:

		'country_of_origin' => array( ? ),
		'release_date' 		=> aarray( ? ),
		'grading' 			=> array( ? ),
		'media_type' 		=> array( ? ),
		'gradingcondition' 	=> array( ? ),
		'genre_name' 		=> array( ? ),

SOURCE: https://www.dropbox.com/s/aurs1k15rmekw3c/excelmusicstack_product.php?dl=0

Any help would be much appreciated

They appear to be cell coordinates within an Excel spreadsheet.

<?php
$source = array(0,2 + $this->productSize*($progress['importedCount']));
//...
$product_name = strval($productSheetObj->getCell(PHPExcel_Cell::stringFromColumnIndex($source[0] + $map['name'][0]) . ($source[1] + $map['name'][1]))->getValue());

They appear to be cell coordinates within an Excel spreadsheet.

Very Interesting. It is using a Excel Spreadsheet Template to send the data to. Could be worth opening it up and working out what column I should be setting.

Thank you StarLion

Any idea what

$merges = array(0,1,1,1, 0,5,1,5, 0,22,1,22, 2,1,2,2, 2,3,2,8, 2,9,2,14, 2,15,2,19, 2,20,2,21, 2,22,2,23, 2,24,2,25);

might be used for?

            for ($i = 0; $i < count($merges); $i += 4) {
                $productSheetObj->mergeCells(PHPExcel_Cell::stringFromColumnIndex($target[0] + $merges[$i]) . ($target[1] + $merges[$i+1]) . ':' . PHPExcel_Cell::stringFromColumnIndex($target[0] + $merges[$i+2]) . ($target[1] + $merges[$i+3])); 
            }

$merges appears to be just what it says on the tin - a group of cells to be merged. Specifically, it would appear that this is a set of 4 coordinates (with a : between them, so a cell range)

Makes sense, with that information I was able to get the script to work with those extra fields

It stops at 1000 on a SSL server, probably the php.ini file

Will check with the web host tomorrow

thanks again

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.