How can EXIF data be extracted from a JPG file in PHP if the exif_read_data() function is not available in version 4.1.2?

In PHP version 4.1.2, the exif_read_data() function is not available for extracting EXIF data from a JPG file. However, you can still extract EXIF data by using alternative methods such as the PHP function iptcparse(). This function can be used to extract IPTC data from an image, which often includes some EXIF information.

// Open the JPG file
$image = 'example.jpg';

// Get IPTC data from the image
$iptc = iptcparse(file_get_contents($image));

// Display the extracted IPTC data
print_r($iptc);