It may be that my idea is not good. what I need to do is select one or more images, click to automatically package the zip file, and then download it. ZIP already exists, PHP does not understand, just make a form on the front end to get multiple image addresses to PHP, and then PHP will traverse and package it into ZIP. PHP {code ...} originally, we wanted to get the specified sr through js... it may be that my idea is not good. what I need to do is select one or more images, click to automatically package the zip file, and then download it.
ZIP already exists, PHP does not understand, just make a form on the front end to get multiple image addresses to PHP, and then PHP will traverse and package it into ZIP.
PHP
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
Originally, we wanted to get the specified src through js.
Js
《script》var images = document.getElementsByClassName("1");var imageStr = "";for(var i=0;i
The output is a piece of data, and php does not know how to write the loop.
Can you help me?
Obtains the image address of the specified class and sends it to the backend for phpzip packaging.
Reply content:It may be that my idea is not good. what I need to do is select one or more images, click to automatically package the zip file, and then download it.
ZIP already exists, PHP does not understand, just make a form on the front end to get multiple image addresses to PHP, and then PHP will traverse and package it into ZIP.
PHP
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
Originally, we wanted to get the specified src through js.
Js
《script》var images = document.getElementsByClassName("1");var imageStr = "";for(var i=0;i
The output is a piece of data, and php does not know how to write the loop.
Can you help me?
Obtains the image address of the specified class and sends it to the backend for phpzip packaging.
$ Imagee = $ _ GET ['Pic ']; foreach ($ imagee as $ k => $ v) {$ image [] = array ('image _ src' => $ v, 'image _ name' => mt_rand (1, 1111 ). '.jpg ');} I think your uploaded variable is a $ _ GET ['Pic'], therefore, you may submit an image at the front end. If you want to submit a group of images, you may refer to the following method: 1.In this way, the $ _ GET ['Pic '] in the background is an array and can be traversed. 2. Use js to json the image address selected at the front end, and assign the valueSubmit the form again, or directly submit the form in js.