Skip to content

Instantly share code, notes, and snippets.

@jfcherng
Last active June 16, 2019 10:24
Show Gist options
  • Save jfcherng/19755723235f50e95a8d03501b7a9dc1 to your computer and use it in GitHub Desktop.
Save jfcherng/19755723235f50e95a8d03501b7a9dc1 to your computer and use it in GitHub Desktop.
Check PHP GD library support
<?php
// Displays details of GD support on your server
echo '<div style="margin: 10px;">';
echo '<p style="color: #444444; font-size: 130%;">GD is ';
if (\function_exists('gd_info')) {
echo '<span style="color: #00AA00; font-weight: bold;">supported</span> by your server!</p>';
$gd = \gd_info();
foreach ($gd as $k => $v) {
echo '<div style="width: 340px; border-bottom: 1px solid #DDDDDD; padding: 2px;">';
echo '<span style="float: left;width: 300px;">' . $k . '</span> ';
if ($v) {
echo '<span style="color: #00AA00; font-weight: bold;">Yes</span>';
} else {
echo '<span style="color: #EE0000; font-weight: bold;">No</span>';
}
echo '<div style="clear:both;"><!-- --></div></div>';
}
} else {
echo '<span style="color: #EE0000; font-weight: bold;">not supported</span> by your server!</p>';
}
echo '<p>by <a href="http://www.dagondesign.com">dagondesign.com</a></p>';
echo '</div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment