lundi 21 décembre 2020

add another array data in array php

hello i am trying to add another array data to an array, i have array like this,

    array:4 [▼
  "data" => array:19 [▼
    0 => array:2 [▼
      0 => array:1 [▼
        "filename" => "a"
      ]
      1 => array:1 [▼
        "filename" => "b"
      ]
    ]
    1 => array:2 [▼
      0 => array:1 [▼
        "filename" => "c"
      ]
      1 => array:1 [▼
        "filename" => "d"
      ]
    ]
    2 => array:2 [▼
      0 => array:1 [▼
        "filename" => "e"
      ]
      1 => array:1 [▼
        "filename" => "f"
      ]
    ]
    
  ]
  "video" => array:2 [▼
    0 => array:1 [▼
      "url" => "x"
    ]
    1 => array:1 [▼
      "url" => "y"
    ]
  ]
  
]

i want array like this

array:4 [▼
  "data" => array:19 [▼
    0 => array:2 [▼
      0 => array:1 [▼
        "filename" => "a",
      ]
      1 => array:1 [▼
        "filename" => "b"
      ],
      2 => array:1 [▼
        "url" => "x"
      ]
    ]
    1 => array:2 [▼
      0 => array:1 [▼
        "filename" => "c"
      ]
      1 => array:1 [▼
        "filename" => "d"
      ],
      2 => array:1 [▼
        "url" => "y"
      ]
    ]
    2 => array:2 [▼
      0 => array:1 [▼
        "filename" => "e"
      ]
      1 => array:1 [▼
        "filename" => "f"
      ],
      2 => array:1 [▼
        "url" => "x"
      ]
    ] 
  ]
]

i am trying to add array but still no result, is any way to solve this issue in php. please suggest me.

"video" data have only 2 , it will repeated , 1-2-3-1-2-3 on that array.

please suggest me how can i solve this



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3h8Jif2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire