我遇到的问题是,我必须计算数组中的缺陷数,并且还要删除名称和问题方面的所有重复,而不仅仅是因果关系。
我尝试使用循环来删除重复的值,但是我不知道如何使用重复次数来更新“数量”列。
我想用唯一值过滤下面的数组,并计算数组中的重复次数,然后将其作为数量输入到顶行。
I need the output like
SlNo name Problem Qty
1. Tata brake 3
2. xeq fuel 2
3. Shift headlight 1
Can anyone help me out with this issue... Thanks
<?PHP
$AryCars = array(
0 => array(
'name' => 'Tata',
'Problem' => 'brake',
'Cause' => 'drum'
'Qty' => '1'
),
1 => array(
'name' => 'xeq',
'Problem' => 'fuel',
'Cause' => 'pump failure'
'Qty' => '1'
),
2 => array(
'name' => 'xeq',
'Problem' => 'fuel',
'Cause' => 'tank damage'
'Qty' => '1'
),
2 => array(
'name' => 'Tata',
'Problem' => 'brake',
'Cause' => 'oil leak'
'Qty' => '1'
),
3 => array(
'name' => 'xeq',
'Problem' => 'fuel',
'Cause' => 'fuel'
'Qty' => '1'
),
4 => array(
'name' => 'Tata',
'Problem' => 'brake',
'Cause' => 'damage'
'Qty' => '1'
),
5 => array(
'name' => 'Shift',
'Problem' => 'headlight',
'Cause' => 'fuse'
'Qty' => '1'
)
)
?>