<?php
$facet_fields = array (
"dx-tx295" => array (
"T",1348,),
"dx-z1" => array (
"F",1,
"G",2,
"E",3,
"D",4,
"C",5,
"H",6,
"B",7,
"I",8,
"J",9,
"K",10,
"A",11,
"L",12,
"M",13,)
)
$catalogue = array();
$value = array();
for ($x=1;$x<count($facet_fields);$x++)
{
for($y=0;$y<count($facet_fields[$x]);$y+2)
{
$current = $facet_fields[$x];
$spot = ($current[$y] => $current[$y+1]);
array_push($value, $spot);
}
}
for($i=0;$i<count($facet_fields);$i++)
{
$spot2 = ($facet_fields[$i]=>$value);
array_push($catalogue, $spot2);
}
print $catalogue
print $value
?>
I am trying to assign each number in the first array to its associated letter, and then add the association to a spot in a new array value. Then I am trying to associate the value arrays to the facet_field arrays and add them to catalogue. It is having a problem with the assigned associations such as the line with $spot.
Is it possible to do this? Or can I not include this many variables in an association? How would I make an associated array in an array like this?
Thanks.