So currently I have an array that pulls data based on an attribute and it puts the data in its own seperate array. What I need to do is to put these 3 arrays into one, so if one of them is null, it won't give me errors. It should be fairly simply but I can't wrap my head around it.
//CV eqpValue
if (is_array(FullDataResponse->dlr->DesignLayoutRecord)) {
foreach(FullDataResponse->dlr->DesignLayoutRecord as $DesignLayoutRecord_key => $DesignLayoutRecord_value ) {
if ($DesignLayoutRecord_value->cktEqpOptions->CktEqpOptions && is_array($DesignLayoutRecord_value->cktEqpOptions->CktEqpOptions)) {
foreach ($DesignLayoutRecord_value->cktEqpOptions->CktEqpOptions as $cv_obj)
{
if($cv_obj->attribute === 'CDR')
{
$this->cvCDRList[] = array("cdr" => $cv_obj->eqpValue);
}
if($cv_obj->attribute === 'CUSTOMER')
{
$this->cvCustomerList[] = array("customer" => $cv_obj->eqpValue);
}
if($cv_obj->attribute === 'LEASE LINE')
{
$this->cvphoneList[] = array("phoneNumber" => $cv_obj->eqpValue);
}
}
}
}
}
See how they are currently put into separate arrays like cvCDRList, cvCustomerList, and cvphoneList? How would I put them into a single array? Thanks!!