开发者

php array. cant get the output i desire. help me

开发者 https://www.devze.com 2023-02-05 20:49 出处:网络
i have this code $dir = \"img/ori/\"; $dir_thumbs = \"img/thumbs/\"; $images = array(); $d =开发者_高级运维 dir($dir);

i have this code

$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);  

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']}";
}
?>


Use print_r or var_dump for this:

print_r($o);
//or
var_dump($o);
0

精彩评论

暂无评论...
验证码 换一张
取 消