Posted By

nicolaspar on 07/18/06


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

meth
postNuKe
trickychicken


Php detectar versión GD


 / Published in: PHP
 

  1. function getVersionGD() {
  2. $gd = array();
  3. $GDfuncList = get_extension_funcs('gd');
  4. @phpinfo(INFO_MODULES);
  5. $output=ob_get_contents();
  6. $matches[1]='';
  7. if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s",$output,$matches)) {
  8. $gdversion = $matches[2];
  9. }
  10. if ($GDfuncList) {
  11. if (in_array('imagegd2', $GDfuncList)) {
  12. $gd['gd2'] = $gdversion;
  13. } else {
  14. $gd['gd1'] = $gdversion;
  15. }
  16. }
  17. return $gd;
  18. }

Report this snippet  

You need to login to post a comment.