random

3 years ago

realtydev

Code

<?php

$imgArr = '[{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1000.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1000.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1000.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1001.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1001.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1001.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1002.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1002.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1002.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1003.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1003.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1003.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1004.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1004.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1004.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1005.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1005.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1005.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1006.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1006.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1006.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1007.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1007.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1007.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1008.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1008.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1008.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1009.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1009.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1009.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1010.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1010.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1010.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1011.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1011.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1011.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1012.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1012.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1012.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1013.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1013.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1013.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1014.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1014.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1014.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1015.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1015.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1015.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1016.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1016.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1016.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1017.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1017.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1017.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1018.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1018.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1018.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1019.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1019.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1019.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1020.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1020.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1020.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1021.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1021.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1021.jpg"},{"highRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1022.jpg","midRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1022.jpg","lowRes":"https:\/\/i.e-net.com\/mls\/import\/DenverCO\/property\/full\/116\/6438116_1022.jpg"}]';


$chunks = array_chunk(json_decode($imgArr), 2);
foreach ($chunks as $chunk) {
    // $chunk contains 25 items
    return $chunk;
    // Call your script here
}

Output

=> [
     {#644
       +"highRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1000.jpg",
       +"midRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1000.jpg",
       +"lowRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1000.jpg",
     },
     {#643
       +"highRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1001.jpg",
       +"midRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1001.jpg",
       +"lowRes": "https://i.e-net.com/mls/import/DenverCO/property/full/116/6438116_1001.jpg",
     },
   ]
New course: Desktop apps with Electron