php8.5
Home/ Manual/ imagick / imagick/ Imagick::queryFormats

Imagick::queryFormats

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Returns formats supported by Imagick

Description

Imagick::queryFormats(string $pattern = "*"): array

Returns formats supported by Imagick.

Parameters

pattern

Return Values

Returns an array containing the formats supported by Imagick.

Errors/Exceptions

Throws

Examples

Imagick::queryFormats()

php
<?php
    function render() {
        $output = "";
        $input = \Imagick::queryformats();
        $columns = 6;

        $output .= "<table border='2'>";

        for ($i=0; $i < count($input); $i += $columns) {
            $output .= "<tr>";
            for ($c=0; $c<$columns; $c++) {
                $output .= "<td>";
                if (($i + $c) <  count($input)) {
                    $output .= $input[$i + $c];
                }
                $output .= "</td>";
            }
            $output .= "</tr>";
        }

        $output .= "</table>";

        return $output;
    }

?>

Source: reference/imagick/imagick/queryformats.xml · from the official PHP manual (php/doc-en)