I have the following array:
$dados = array(
'0' => array(
'id_assinante' => $id,
'nome' => 'Aluguel'
),
'1' => array(
'id_assinante' => $id,
'nome' => 'Água'
),
'2' => array(
'id_assinante' => $id,
'nome' => 'Contabilidade'
),
'3' => array(
'id_assinante' => $id,
'nome' => 'Energia'
),
'4' => array(
'id_assinante' => $id,
'nome' => 'Imposto'
),
'5' => array(
'id_assinante' => $id,
'nome' => 'IPTU'
),
'6' => array(
'id_assinante' => $id,
'nome' => 'Marketing'
),
'7' => array(
'id_assinante' => $id,
'nome' => 'Telefone'
)
);
In this case it works perfectly, but is there any way to do this more simply? Since $id
will always be equal, and each value in the name field will have a different name?