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
Post a Comment