How to pass url to read png files in php -


if do

$dir = './'; $files = glob( $dir . '*.png'); foreach( $files $file) {     echo $file; } ?> 

and store php file in same folder images correct png files.

if change location of php file how can read png files located in other folder?

if do

$dir = 'www.site.com/content/images'; $files = glob( $dir . '*.png'); foreach( $files $file) {     echo $file; } 

it not display anything, necessary php file code in same folder of images?

you shouldn't add "www.site.com" path. should use absolute path root of server (beginning "/": /content/images) or relative path current location of php script (content/images).


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -