iptcparse()

iptcparse() — Parse a binary IPTC block into single tags.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

iptcparse(string $iptc_block): array|false

Parameters

ParameterTypeWhat it takes
$iptc_blockstringA binary IPTC block.

Return value

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.

Example

A runnable snippet:

$size = getimagesize('./test.jpg', $info); if(isset($info['APP13'])) { $iptc = iptcparse($info['APP13']); var_dump($iptc); }

All PHP 8.5 built-in functions

Reference card built from the PHP manual page iptcparse() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.