I am writing a search engine script -- I need to know how to get any directory on my server (I know how to read directories, but not how to list them all: for example:

Index.php
Visitor (DIRECTORY)
Domain (DIRECTORY)
stats.php

how could i get it to grab the name of every directory/single file on myself and echo it or add it to an array?
EDIT: NEVERMIND, SCANDIR() SHOULD WORK.