1<?php 2 3function get_zlib_version() 4{ 5 $version = NULL; 6 7 ob_start(); 8 phpinfo(); 9 $info = ob_get_contents(); 10 ob_end_clean(); 11 //if (preg_match(',zlib.*Compiled Version => (\d+\.\d+\.\d+),s', $info, $match)) { 12 // $version = $match[1]; 13 if (preg_match(',zlib(?!.*libXML).*Compiled Version (=> |</).*(\d+\.\d+\.\d+?),sU', $info, $match)) { 14 $version = $match[2]; 15 } 16 17 return $version; 18} 19