如何使用explode函数从文件夹中获取所有图像数组?

时间:2017-10-23 06:37:53

标签: php mysql

我只能获取数据库每一行的第一张图像。如何使用预编译语句和爆炸功能获取所有图像。

context.xml

uploads folder structure of images

Images are saved in database in this format.I want to fetch these images

1 个答案:

答案 0 :(得分:0)

在迭代数组索引爆炸后尝试循环遍历数组:

for($i=0; $i<count($property_img2); $i++){
    echo  '<img class="img-zoom" src="uploads/' . $property_img2[$i] . '" width="200" height="150" alt="not fetched">&nbsp;&nbsp;';
}

然而,我同意您的设计很差的评论,并且您可能会考虑将其更改为一对多关系。