read()) { if (substr($file, 0, 1) != '.') { $subdir = dir($path . '/' . $file); while ($subfile = $subdir->read()) { if (substr($subfile, 0, 1) != '.') { $url = "http://services.0xdb.org/posters/$path/$file/$subfile"; $size = getimagesize($url); echo "poster[$i] = [];\n"; echo "poster[$i]['url'] = '$url';\n"; echo "poster[$i]['width'] = " . $size[0] . ";\n"; echo "poster[$i]['height'] = " . $size[1] . ";\n"; $i++; } } } } $rnd = floor(mt_rand() / mt_getrandmax() * count($poster)); ?>