'products_image_med' + 'products_image_xl_1' + 'products_image_xl_2'
y otro por ejemplo:
'products_image_med' + 'products_image_xl_1' + 'products_image_xl_2' + 'products_image_xl_3' + 'products_image_xl_4' + 'products_image_xl_5' + 'products_image_xl_6'
el problema es solo deseo que me genere un zip con el 'products_image_med' y tantos 'products_image_xl_' como existan para ese $product_info.
Código PHP:
<?
if(file_exists("tmp/".$_GET['products_id'].".zip")) {
}else {
include("createzip.php");
$imagen1 = "images/". $product_info['products_image_med'];
$imagen2 = "images/". $product_info['products_image_xl_1'];
$imagen3 = "images/". $product_info['products_image_xl_2'];
$imagen4 = "images/". $product_info['products_image_xl_3'];
$imagen5 = "images/". $product_info['products_image_xl_4'];
$imagen6 = "images/". $product_info['products_image_xl_5'];
$imagen7 = "images/". $product_info['products_image_xl_6'];
$cont=array("foto1.jpg"=> file_get_contents($imagen1),
"foto2.jpg"=> file_get_contents($imagen2),
"foto3.jpg"=> file_get_contents($imagen3),
"foto4.jpg"=> file_get_contents($imagen4),
"foto5.jpg"=> file_get_contents($imagen5),
"foto6.jpg"=> file_get_contents($imagen6),
"foto7.jpg"=> file_get_contents($imagen7),
);
createzip($cont,"tmp/".$_GET["products_id"].".zip") or die("Error: al construir el ZIP.");
}
?>