I have JPG image with XMP meta data inside.
I'd like to read this data, but how?
$content = file_get_contents($fileName);
var_dump($content);
displays real number of bytes 553700
but
$len = strlen($content);
var_dump($len);
displays 373821
So, I can't simple do
$xmpStart = strpos($content, '<x:xmpmeta');
because I get wrong offset.
So, the question is, how to find and read string from binary file in PHP?
(I have mb_string option ON in php.ini)
UPD1:
I have some binary file. How can I check in PHP, this file contains several strings or not?
strlen($content, "iso-8859-1")gives the correct value?$pos = strpos($content, '<x:xmpmeta', 0, 'iso-8859-1');now it pointers to right offset. Thanks. But how can I know about lastencodingparameter? :) There is no information about this in php.net/manual/en/function.strpos.php huh...