$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
This can only be read one line, the front desk to submit multiple pic
Each format is: http://www.baidu.com/1.jpg orgif
I used another method to get all the image addresses, formatted as follows
http://www.baidu.com/1.jpg分隔符http://www.baidu.com/2.jpg分隔符http://www.baidu.com/3.jpg
How do I get it to traverse through PHP into the style I want?
Reply content:
$imagee = $_GET['pic']; foreach ($imagee as $k => $v) { $image[]= array( 'image_src' =>$v, 'image_name' => mt_rand(1, 1111) . '.jpg' ); }
This can only be read one line, the front desk to submit multiple pic
Each format is: http://www.baidu.com/1.jpg orgif
I used another method to get all the image addresses, formatted as follows
http://www.baidu.com/1.jpg分隔符http://www.baidu.com/2.jpg分隔符http://www.baidu.com/3.jpg
How do I get it to traverse through PHP into the style I want?
Walk into the style you want? What style. If I'm wrong about what you mean, then explode ?
//这里假设分割符是__(两个英文下划线)$pic = "http://www.baidu.com/1.jpg__http://www.baidu.com/2.jpg__http://www.baidu.com/3.jpg";$arr = explode('__', $pic);foreach($arr as $key => $v) { unset($arr[$key]); $arr[$key]['image_src'] = $v; $arr[$key]['image_name'] = mt_rand(1, 1111).'.jpg';}print_r($arr);
Do not know whether I did not understand the meaning, and the landlord's code is not a big difference ah, just one moreexplode