Loading files in a folder using php -


i tried loading names of files in books directory, following code:

<?php    if ($handle = opendir('/books')) {     echo "directory handle: $handle\n";     echo "entries:\n";      while (false !== ($entry = readdir($handle))) {       echo "$entry\n";     }  closedir($handle);  } ?> 

but seems not display names. doing wrong or not locating right directory?

seems if you're using wrong directory... think books folder in same directory script?

then use opendir('books') relative path directory.

when use /books use books folder located in root directory of filesystem. (this called absolute path)


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -