Your question is very basic.
I advise for you to go to www.linuxguruz.org and click on PHP tutorials. Scroll down, and you'll find nice and really short tutorial on how to generate random passwords. It's really great - no fluff, just the good stuff.
Di