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
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号