To change permission by type (directory or file), the easiest way can do it is using find command and do something as a follow up action.
To change permission for file by 0664,
find ./ -type f -exec chmod -v 0664 {} \;
Note that you should put space between {} and \
To change permission for directory by 0775
find ./ -type d -exec chmod -v 0775 {} \;
To change permission for some files like "*.php"
find ./ -type f -name "*.php" -exec chmod 0664 -v 0664 {} \;
To change permission except some files like "*.log"
find ./ -type f \! -name "*.log" -exec chmod 0664 -v 0664 {} \;