通过PHP解释GD信息

时间:2015-04-16 04:55:54

标签: php gd

我正在检查我的GD库,当我运行此代码时: -

<?php

$a=gd_info();
foreach ($a as $key=>$value){
    echo $key | $value . '<br>';
}
?>

它给了我以下输出:

gunvmwwio~.0.34 compatible)
w~gw~ype Supportw{umtree|y~o}gw>|s~b Supportw}fr~ead Supportw}frreate Support{|gw>Supportq~grupportw~or>Support|r>Supporty~orupport~ks?mapped Japanese Font Support

我知道如何获得正确的输出。但我只是想知道这个输出的确切含义。

1 个答案:

答案 0 :(得分:2)

首先,您创建的乱码文本并不完全正确。要正确显示正确的值,请正确包装引号:

$a = gd_info();
foreach ($a as $key=>$value){
    echo "$key | $value <br/>";
    // wrap them all including the pipe
}

所以作为回报,你会得到这样的东西:

// the actual correct output
GD Version |    2.0.36
FreeType Support |  1
FreeType Linkage |  with freetype
T1Lib Support | 
GIF Read Support |  1
GIF Create Support |    1
JPEG Support |  1
PNG Support |   1
WBMP Support |  1
XPM Support |   
XBM Support |   
JIS-mapped Japanese Font Support |

实际上此信息与查看GD上的phpinfo()信息基本相同

Sample Output