I'm developing a website where I need to extract the metadata of an image (jpeg) with exiftool. I'm doing it with this code:
$cmd = exec("exiftool ".$this->url, $result);
$result
is now a classic array:
array (size=113)
0 => string 'ExifTool Version Number : 10.40' (length=39)
1 => string 'File Name : photo7.jpg' (length=44)
2 => string 'Directory : images' (length=40)
3 => string 'File Size : 139 kB' (length=40)
4 => string 'File Modification Date/Time : 2017:11:26 16:27:05+01:00' (length=59)
5 => string 'File Access Date/Time : 2017:12:17 23:07:18+01:00' (length=59)
6 => string 'File Inode Change Date/Time : 2017:11:26 16:27:05+01:00' (length=59)
7 => string 'File Permissions : rw-r--r--' (length=43)
8 => string 'File Type : JPEG' (length=38)
9 => string 'File Type Extension : jpg' (length=37)
...
But I want to turn this array into an other array with meaningful keys and not numbers. Something even better would be to have a json object. In any case, I want the final array to looks like this:
array (size=113)
'ExifTool Version Number' => string '10.40' (length=5)
'File Name' => string 'photo7.jpg' (length=10)
...
Is there a simple way to achieve this?