php数组.无法获得我想要的输出.帮我 [英] php array. cant get the output i desire. help me
本文介绍了php数组.无法获得我想要的输出.帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此代码
$dir = "img/ori/";
$dir_thumbs = "img/thumbs/";
$images = array();
$d = dir($dir);
while($name = $d->read()){
$thumb = "thumb_".$name;
$images[] = array('name' => $name,'thumb_url' => $dir_thumbs.$thumb);
}
$d->close();
$o = array('images'=>$images);
我要输出所有图像的$ name和$ thumb_url.怎么做.?帮帮我
i want to output $name and $thumb_url of all the images. how to do it.? help me
推荐答案
<?php
foreach ($images as $image) {
echo "{$image['name']} {$image['thumb_url']}";
}
?>
这篇关于php数组.无法获得我想要的输出.帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文