note 35352 added to function.gd-info

From: Date: Thu, 28 Aug 2003 13:40:39 +0000
Subject: note 35352 added to function.gd-info
Groups: php.notes 
Request: Send a blank email to php-notes+get-55235@lists.php.net to get a copy of this message
Since I noted that gd_info() returned on my system more info than the manual said (11 fields instead of 9, the extra fields are FreeType Linkage Support and JIS-mapped Japanese Font Support), I wrote these two little functions that dump the information returend by gd_info() in a dynamical and colored way. <? function describeGDdyn(){ echo "<ul>"; echo "<li>GD support: "; if(function_exists("gd_info")){ echo "<font color=\"#00ff00\">yes</font>"; $info = gd_info(); $keys = array_keys($info); for($i=0;$i<count($keys);$i++){ echo "</li>\n<li>".$keys[$i] .": " . yesNo($info[$keys[$i]]); } }else{ echo "<font color=\"#ff0000\">no</font>"; } echo "</li></ul>"; } function yesNo($bool){ if($bool){ return "<font color=\"#00ff00\"> yes</font>"; }else{ return "<font color=\"#ff0000\"> no</font>"; } } describeGDdyn(); ?> ---- Manual Page -- http://www.php.net/manual/en/function.gd-info.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35352 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35352&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35352&report=yes

« previous php.notes (#55235) next »