johnschaefer at gmx dot de
10-Apr-2003 08:25
this is a replacement for this function.
you can also use this function
in php >= 4.3.
the handling is the same as the gd_info function
(array gd_info(void))
<?php
$code = 'function gd_info() {
$array = Array(
"GD Version"
=> "",
"FreeType Support"
=> 0,
"FreeType Support" =>
0,
"FreeType Linkage" =>
"",
"T1Lib Support" =>
0,
"GIF Read Support" => 0,
"GIF Create Support" => 0,
"JPG Support" => 0,
"PNG
Support" => 0,
"WBMP Support"
=> 0,
"XBM Support" => 0
);
$gif_support = 0;
ob_start();
eval("phpinfo();");
$info =
ob_get_contents();
ob_end_clean();
foreach(explode("\n", $info) as $line) {
if(strpos($line, "GD Version")!==false)
$array["GD Version"] = trim(str_replace("GD Version",
"", strip_tags($line)));
if(strpos($line,
"FreeType Support")!==false)
$array["FreeType Support"] = trim(str_replace("FreeType
Support", "", strip_tags($line)));
if(strpos($line, "FreeType Linkage")!==false)
$array["FreeType Linkage"] = trim(str_replace("FreeType
Linkage", "", strip_tags($line)));
if(strpos($line, "T1Lib Support")!==false)
$array["T1Lib Support"] = trim(str_replace("T1Lib
Support", "", strip_tags($line)));
if(strpos($line, "GIF Read Support")!==false)
$array["GIF Read Support"] = trim(str_replace("GIF Read
Support", "", strip_tags($line)));
if(strpos($line, "GIF Create Support")!==false)
$array["GIF Create Support"] = trim(str_replace("GIF Create
Support", "", strip_tags($line)));
if(strpos($line, "GIF Support")!==false)
$gif_support = trim(str_replace("GIF Support", "",
strip_tags($line)));
if(strpos($line, "JPG
Support")!==false)
$array["JPG Support"]
= trim(str_replace("JPG Support", "",
strip_tags($line)));