The output of PHP files is HTML. That HTML will be compressed using the code in this questionthe code in this question:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript application/json
That's all you need to do (assuming mod_deflate is enabled for Apache).