Home >Backend Development >PHP Tutorial >Problem with php post receiving.
HTML 向PHP post一条数据 $_POST['pic'];
其中数据为http://www.baidu.com/1.pic;ht...等等
如何循环这条语句 每个$pic获取一条地址
<code> array('image_src' => $pic, 'image_name' => '随机字符串.jpg'), );</code>
HTML 向PHP post一条数据 $_POST['pic'];
其中数据为http://www.baidu.com/1.pic;ht...等等
如何循环这条语句 每个$pic获取一条地址
<code> array('image_src' => $pic, 'image_name' => '随机字符串.jpg'), );</code>
HTML
<code class="html"><form action="http://www.godruoyi.com/" method="get"> <input type="text" name="pic[]"> <input type="text" name="pic[]"> <input type="text" name="pic[]"> <input type="text" name="pic[]"> <input type="submit" name="save"> </form></code>
php
<code class="php"> $pics = $_GET['pic']; $data = []; foreach ($pics as $key => $value) { $data[] = [ 'image_src' =>$value, 'image_name' => mt_rand(1, 1111) . '.jpg' ]; } //over</code>
pic[]=XXX.jpg&pic[]=XXX.jpg