Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] zmiana ciągu znaków w tablice
Regss
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 7.05.2006

Ostrzeżenie: (0%)
-----


Witam! Potrzebuje małej pomocy.
Przykładowo mam taki oto ciąg znaków:
Kod
File Size : 79 kB : Make : Canon : Camera Model Name : Canon PowerShot A510 : Create Date : 2005:07:20 05:05:27 : Exposure Time : 1/125 : F Number : 8.0 : Flash : On, Red-eye reduction : Exposure Compensation : 0 : Focal Length : 23.2mm : White Balance : Auto : Image Size : 640x480


i chciał bym przekształcić go na tablice wyglądającą następująco:

Kod
[File Size] => 79 kB
[Make] => Canon
[Camera Model Name] => Canon PowerShot A510
[Create Date] => 2005:07:20 05:05:27
itd...


Domyślam się, że trzeba urzyć funkcji explode() tylko nie wiem dokładnie jak. Proszę o pomoc. Pozdrawiam.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Regss
post
Post #2





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 7.05.2006

Ostrzeżenie: (0%)
-----


  1. <?
  2. $exif_filename = "test2.jpg";
  3. $exif_image_path = "$exif_filename";
  4. $perl_path = "/usr/bin/perl";
  5. $exiftool_path = "cgi-bin/exiftool";
  6. exec("$perl_path $exiftool_path -filesize -make -model -createdate -exposuretime -fnumber -iso -flash -exposurecompensation -focallength -quality -whitebalance -imagesize $exif_image_path", $exif_table);
  7. $exif_table_re = implode($exif_table, " : ");
  8. $tmp = split(":", $exif_replace_re);
  9. for($i=0; $i<count($tmp); $i+=2){
  10. $exif[trim($tmp[$i])] = $tmp[($i+1)];
  11. }
  12. var_dump($exif);
  13. ?>


Nie wiem jaki tu jest błąd.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.09.2025 - 22:23