$regras = array(
array(
'field' => 'cpf',
'label' => 'CPF',
'rules' => 'required'
),
array(
'field' => 'senha',
'label' => 'SENHA',
'rules' => 'required|trim'
));
// o array $maisUmCriterio tem que ser inserido dentro de $regras
$maisUmCriterio =
array(
'field' => 'nome',
'label' => 'NOME',
'rules' => 'required|trim'
);
já tentei fazer
$regras = $regras + $maisUmCriterio;
mas não funciona, preciso que o array $regras fique assim :
$regras = array(
array(
'field' => 'cpf',
'label' => 'CPF',
'rules' => 'required'
),
array(
'field' => 'senha',
'label' => 'SENHA',
'rules' => 'required|trim'
),
array(
'field' => 'nome',
'label' => 'NOME',
'rules' => 'required|trim'
)
);
A forma mais simples:
$regras[] = $maisUmCriterio;
A forma mais complicada:
array_push($regras, $maisUmCriterio);
Referências
https://secure.php.net/manual/pt_BR/language.types.array.php
http://php.net/manual/pt_BR/function.array-push.php
Grato resolvido.