Php Function To List All Files

What would be the best way to list all the files in one directory with PHP? Is there a $_SERVER function to do this? I would like to list all the files in the usernames/ directory and loop over that.
As of PHP5, this function seems to return an array with the first index being the script all subsequent scripts are included to. If index.php includes b.php and c.php and calls get_included_files(), the returned array looks as follows: index.php a.php b.php while in PHP. Backup And Restore Hp Procurve Switch Configuration Examples on this page.
Something that's not noted in the docs, if a file is included remotely and you do a get_included_files() in the include itself it will *not* return the document that included it. Ie: test2.php (server 192.168. 163 06 Aggiornato Pdf Printer here. 1.14): test3.php (server 192.168.1.11): returns: Array ( [0] =>/var/www/localhost/htdocs/test/test3.php ) Which means you can use get_included_files() to help intercept and prevent XSS-style attacks against your code.
As of PHP5, this function seems to return an array with the first index being the script all subsequent scripts are included to. If index.php includes b.php and c.php and calls get_included_files(), the returned array looks as follows: index.php a.php b.php while in PHP. Something that's not noted in the docs, if a file is included remotely and you do a get_included_files() in the include itself it will *not* return the document that included it. Ie: test2.php (server 192.168.1.14): test3.php (server 192.168.1.11): returns: Array ( [0] =>/var/www/localhost/htdocs/test/test3.php ) Which means you can use get_included_files() to help intercept and prevent XSS-style attacks against your code.