This is my code:
foreach ($category_attribute_list_value as $key => $value) {
foreach ($value as $key2 => $value_fial) {
if($key==0){
$x[]=$value_fial->attribute_value;
$x_id[]=$value_fial->attribute_value_id;
}
}}
foreach ($category_attribute_list_value as $key_y => $value_y) {
foreach ($value_y as $key2_y => $value_fial_y) {
if($key_y!=0)
{
$y[]=$value_fial_y->attribute_value;
$y_id[]=$value_fial_y->attribute_value_id;
}
}}
In an above code $x contain two value (L,XL) and same for $y, it's have two value (Blue, Green).
Now came to table data code
My table code is:
echo'<table cellpadding="0" cellspacing="0" border="1" class="pro_code_table">
<tr>
<td class="table_val_data">Code</td>';
foreach($x as $k_x => $v_x){
echo'<td class="table_val_data">'.$v_x.'</td>';
}
echo'</tr>';
foreach($y as $k_y_t=> $v_y_t){
echo'<tr><td class="table_val_data">'.$v_y_t.'</td>';
foreach($y as $k_y=> $v_y){
foreach($x as $k_x => $v_x){
$i=1;
if($k_y_t==$k_y){
echo'<td class="table_val_data">';
//foreach($pro_code as $k_pro_code=> $v_pro_code){
//if($k_x.'-'.$k_y==$k_pro_code){
echo '<input type="text" name="edit_pro_code[]" value="'.$i.'"">';
//}
//}
echo'</td>';
}
}
$i++;
}
echo'</tr>';
}
echo'</table>';
In an table code We split the data into X and y axises, X for an $x and y for an $y.
The whole table looped more the one time (assume it..!), in this cause only we have an error in looping
An first time looped data
The $y value is like this Array ( [0] => bule [1] => green )
Next time looping i want the same data, but i have the below o/p
Array ( [0] => bule [1] => green [2] => L [3] => XL [4] => bule [5] => green )

