Maybe my train of thought is not good, to do is a multi-select picture, click on the Auto Pack zip, and then in the download.
Zip already has, PHP does not understand, on the front end made a form get multiple picture address to PHP, and then PHP in the traversal package into zip.
Php
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
Originally wanted to get the specified src by JS
Js
Discovery output is a piece of data, PHP does not know how to write loops
Can you help me see
Gets the picture address of the specified class and passes it to the background Phpzip package
Reply content:
Maybe my train of thought is not good, to do is a multi-select picture, click on the Auto Pack zip, and then in the download.
Zip already has, PHP does not understand, on the front end made a form get multiple picture address to PHP, and then PHP in the traversal package into zip.
Php
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
Originally wanted to get the specified src by JS
Js
Discovery output is a piece of data, PHP does not know how to write loops
Can you help me see
Gets the picture address of the specified class and passes it to the background Phpzip package
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }我看你这段代码感觉你上传的变量就是一个$_GET['pic'],所以你在前端很可能提交的是一张图片还不是一段图片吧。如果你要提交一组图片,可能参考下下面的方式:1。这样在后台$_GET['pic']得到的就是一个数组了,可以遍历了。2。使用js把前台选中的图片地址,json化,然后赋值给再提交表单,或者直接js提交表单。