Hello,
I want array in format
$xyz[]=array($key=>'Some value here',$value=>array('value1','value2));
In below code,
I want it in loop by checking if $ManagerGSID value is not in $xyz[] as $key then insert into it. (as key will $ManagerGSID and value will be array ($EmployeeGSID))
again if got the same $ManagerGSID then push $EmployeeGSID to the last of array ($EmployeeGSID,$EmployeeGSID)
But if $ManagerGSID is not in $xyz array then make new entry of it in xyz as key= $ManagerGSID and value as array ($EmployeeGSID)
But how to do it?
$managers=array();
//$xyz[]=array($key=>'',$value=>array());
foreach($Skills as $_Skills)
{
$EmployeeGSID=$_Skills['uid'];
//fetch Manager of employee
$ManagerGSID=helpers::getManager($EmployeeGSID);
//push manager id in array if it is not already in array
if (!in_array($ManagerGSID, $managers))
{
array_push($managers,$ManagerGSID);
//array_push($xyz,$key=>$ManagerGSID,$value=>array_merge($value,$EmployeeGSID)); // want here like this
}
}