Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/02/2018, 10:58
sarrhen
 
Fecha de Ingreso: mayo-2013
Ubicación: San Vicente
Mensajes: 127
Antigüedad: 10 años, 11 meses
Puntos: 1
Respuesta: Copiar elementos de un array dentro del mismo array

Código PHP:
Ver original
  1. $data = array($Prestamo,$NombreCliente,$Monto,$Matricula);
  2.  
  3. $nuevo = array();
  4. for($i= count($Matricula); $i < count($data); $i++ ){
  5.     array_push($nuevo, array(
  6.         $data[0],
  7.         $data[1],
  8.         $data[2],
  9.         $data[$i],
  10.     ));
  11. }
  12. echo print_r($nuevo);

$Matricula en esta variable guardo N numero de array

Me supongo que $i es el inicializador yo le estoy estableciendo segun el numero de elementos por que esta compuesto el array

y esto me mostro
Array ( [0] => Array ( [0] => 0032017777 [1] => EVER FRANCISCO ALMENDAREZ [2] => 10000 [3] => Array ( [0] => 55 [1] => 66 [2] => 88 ) ) ) 1