PHP Password Generator

PHP code for a password generator. You are able to select the password length and whether you would like to include lowercase and uppercase letters, numbers and special characters. It's random, so sometimes you see special characters, numbers etc and other times you don't - even if you have those boxes ticked.