note 35352 modified in function.gd-info by vincent
| From: | vincent@php.net | Date: | Thu, 28 Aug 2003 14:05:35 +0000 |
| Subject: | note 35352 modified in function.gd-info by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55245@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=1;$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();
?>
--was--
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();
?>
http://www.php.net/manual/en/function.gd-info.php