In PHP3 how can I get the listings of a dir into an array?

I know it has something to do with readdir() and such, I just can't get the looping to work right.

Thanks,

-Matt