Have look these array i wanted this in like any on help me

[
   {
     "id": 799,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21-batch393_1_2000x2500-1678515725402-171977216.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 800,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-120_1600x2000-1678515740487-590124449.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 801,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-87_1600x2000-1678515753953-287983011.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 802,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/Camp-Short-1_2000x2500-1678515769679-676176244.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 803,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-122_1600x2000-1678515784575-793565302.jpg",
     "products": [
       {}
     ]
   },
   {
     "id": 804,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/F20lifestyle200_3200x4000-1678515804301-329546354.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 805,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/F20lifestyle136_3200x4000-1678515821877-272369524.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 806,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/jacket-1678515841319-750438839.jpg",
     "products": [
       {}
     ]
   },
   {
     "id": 807,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/sweters-1678515869248-264729543.jpg",
     "products": [
       {}
     ]
   }
 ]

this above first array and second array as follows i want combine both but id and insta_image_id not repeated can any one help me.

[
   {
     "insta_image_id": "799",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21-batch393_1_2000x2500-1678515725402-171977216.jpeg",
     "products": [
       {
         "product_id": "7052915081259",
         "top_cord": "22.22",
         "left_cord": "41.85",
         "handle": "the-mens-long-sleeve-tee"
       },
       {
         "product_id": "7052914819115",
         "top_cord": "43.08",
         "left_cord": "44.77",
         "handle": "womens-distance-running-shorts"
       },
       {
         "product_id": "7052924157995",
         "top_cord": "34.5",
         "left_cord": "28.47",
         "handle": "striped-pocket-tee"
       }
     ]
   },
   {
     "insta_image_id": "800",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-120_1600x2000-1678515740487-590124449.jpeg",
     "products": [
       {
         "product_id": "7052914819115",
         "top_cord": "46.2",
         "left_cord": "50.12",
         "handle": "womens-distance-running-shorts"
       }
     ]
   },
   {
     "insta_image_id": "801",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-87_1600x2000-1678515753953-287983011.jpeg",
     "products": [
       {
         "product_id": "7052915015723",
         "top_cord": "47.76",
         "left_cord": "52.07",
         "handle": "performance-polo-tee"
       }
     ]
   },
   {
     "insta_image_id": "802",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/Camp-Short-1_2000x2500-1678515769679-676176244.jpeg",
     "products": [
       {
         "product_id": "7052915081259",
         "top_cord": "36.84",
         "left_cord": "62.77",
         "handle": "the-mens-long-sleeve-tee"
       }
     ]
   },
   {
     "insta_image_id": "804",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/F20lifestyle200_3200x4000-1678515804301-329546354.jpeg",
     "products": [
       {
         "product_id": "7052914786347",
         "top_cord": "38.01",
         "left_cord": "59.37",
         "handle": "men-sleeve-shirts"
       }
     ]
   }
 ]

I want like this array

[
   {
     "insta_image_id": "799",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21-batch393_1_2000x2500-1678515725402-171977216.jpeg",
     "products": [
       {
         "product_id": "7052915081259",
         "top_cord": "22.22",
         "left_cord": "41.85",
         "handle": "the-mens-long-sleeve-tee"
       },
       {
         "product_id": "7052914819115",
         "top_cord": "43.08",
         "left_cord": "44.77",
         "handle": "womens-distance-running-shorts"
       },
       {
         "product_id": "7052924157995",
         "top_cord": "34.5",
         "left_cord": "28.47",
         "handle": "striped-pocket-tee"
       }
     ]
   },
   {
     "insta_image_id": "800",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-120_1600x2000-1678515740487-590124449.jpeg",
     "products": [
       {
         "product_id": "7052914819115",
         "top_cord": "46.2",
         "left_cord": "50.12",
         "handle": "womens-distance-running-shorts"
       }
     ]
   },
   {
     "insta_image_id": "801",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-87_1600x2000-1678515753953-287983011.jpeg",
     "products": [
       {
         "product_id": "7052915015723",
         "top_cord": "47.76",
         "left_cord": "52.07",
         "handle": "performance-polo-tee"
       }
     ]
   },
   {
     "insta_image_id": "802",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/Camp-Short-1_2000x2500-1678515769679-676176244.jpeg",
     "products": [
       {
         "product_id": "7052915081259",
         "top_cord": "36.84",
         "left_cord": "62.77",
         "handle": "the-mens-long-sleeve-tee"
       }
     ]
   },
   {
     "insta_image_id": "804",
     "insta_gallery_id": 20,
     "src": "https://cdn.myshopapps.com/shoppable-photogallery/6/F20lifestyle200_3200x4000-1678515804301-329546354.jpeg",
     "products": [
       {
         "product_id": "7052914786347",
         "top_cord": "38.01",
         "left_cord": "59.37",
         "handle": "men-sleeve-shirts"
       }
     ]
   },
    {
     "id": 803,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/s21lifestyle-batch2-122_1600x2000-1678515784575-793565302.jpg",
     "products": [
       {}
     ]
   },
   {
     "id": 805,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/F20lifestyle136_3200x4000-1678515821877-272369524.jpeg",
     "products": [
       {}
     ]
   },
   {
     "id": 806,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/jacket-1678515841319-750438839.jpg",
     "products": [
       {}
     ]
   },
   {
     "id": 807,
     "img_name": "6",
     "cloud_url": "https://cdn.myshopapps.com/shoppable-photogallery/6/sweters-1678515869248-264729543.jpg",
     "products": [
       {}
     ]
   }
 ]

yes your right, how can i can i do this… i tried with mysql query so that not need this extra work. can you help me the what changes in database so that i can combine both result.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.