Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

iptcparse

Description

The iptcparse of Image for PHP parse a binary IPTC block into single tags.

Syntax

iptcparse(
    string $iptc_block
): array|false

Parameters

iptc_block

A binary IPTC block.

Return

Returns an array using the tagmarker as an index and the value as the value. It returns false on error or if no IPTC data was found.

Examples

1 · return

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/jpg/2.jpg';
getimagesize($filename, $image_info);

$iptc_block = $image_info['APP13'];

$return = iptcparse($iptc_block);

print_r($return);

?>
Array
(
    [2#005] => Array
        (
            [0] => DocumentTitle
        )

    [2#010] => Array
        (
            [0] => Urgency
        )

    [2#015] => Array
        (
            [0] => Category
        )

    [2#020] => Array
        (
            [0] => Subcatagories
        )

    [2#040] => Array
        (
            [0] => SpecialInstructions
        )

    [2#055] => Array
        (
            [0] => CreationDate
        )

    [2#080] => Array
        (
            [0] => AuthorByline
        )

    [2#085] => Array
        (
            [0] => AuthorTitle
        )

    [2#090] => Array
        (
            [0] => City
        )

    [2#095] => Array
        (
            [0] => State
        )

    [2#101] => Array
        (
            [0] => Country
        )

    [2#103] => Array
        (
            [0] => OTR
        )

    [2#105] => Array
        (
            [0] => Headline
        )

    [2#110] => Array
        (
            [0] => Source
        )

    [2#115] => Array
        (
            [0] => PhotoSource
        )

    [2#116] => Array
        (
            [0] => Copyright
        )

    [2#120] => Array
        (
            [0] => Caption
        )

    [2#122] => Array
        (
            [0] => CaptionWriter
        )

)
HomeMenu