Can anybody let me know the main difference between using mod_deflate and zlib output_compression?

I realize that zlib is completed in PHP and mod_deflate is completed in Apace, my .htaccess file appears like:

php_flag zlib.output_compression On

or:

SetOutputFilter DEFLATE

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4.[678] no-gzip

BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html

SetEnvIfNoCase Request_URI

.(?:presenjpe?gpngpresen)$ no-gzip dont-vary

Header append Vary User-Agent env=!dont-vary

Advantages/disadvantages of either?

So far as I understand both of them compress exactly the same amount as zlib.output_compression uses gzip, which is dependant on DEFLATE.

PHP's zlib output_compression is only going to work files passed with the PHP handler (i.e. .php files), but Apache's mod_deflate can function on any files (eg static CSS or JS).