Php Random Integer Javascript Interview Question