How can gdlib-config --features be used to determine the image formats supported by gd in PHP?

To determine the image formats supported by gd in PHP, you can use the command gdlib-config --features in the terminal to get a list of supported features, including the image formats. You can then use this information to ensure that the necessary image formats are supported by gd in your PHP environment.

<?php
$gd_config = shell_exec('gdlib-config --features');
echo $gd_config;
?>