Siedze nad tymi tablicami i chyba mi sie w glowie juz miesza bo to raczej proste zagadnienie ale nie moge dojsc do tego
Mam taki kawalek kodu :
foreach($struct as $st) { $section = mailparse_msg_get_part($mime, $st); $info = mailparse_msg_get_part_data($section); //print_r($info); if($info['headers']['subject'] !== null && $info['headers']['date'] !== null) { $part[]['subjects'] = $info['headers']['subject']; $part[]['date'] = $info['headers']['date']; } }
W efekcie czego dostaje taka tablice :
Cytat
Array ( [0] => Array ( [subjects] => Generic Cialis, branded quality@ ) [1] => Array ( [date] => Sun, 08 Apr 2007 21:00:48 +0300 ) [2] => Array ( [subjects] => [R] Confidence-Intervals.... help... ) [3] => Array ( [date] => Sun, 8 Apr 2007 10:19:39 -0700 (PDT) ) [4] => Array ( [subjects] => For Smile ) [5] => Array ( [date] => Sun, 8 Apr 2007 17:20:59 +0300 ) [6] => Array ( [subjects] => Less weight - more pleasure and joy ) [7] => Array ( [date] => Sun, 8 Apr 2007 17:22:07 -0100 ) [8] => Array ( [subjects] => Anatrim will change your life ) [9] => Array ( [date] => Sun, 8 Apr 2007 17:22:19 -0100 ) [10] => Array ( [subjects] => problems in animal studies using rats or rabbits feeding outdoor ) [11] => Array ( [date] => Sun, 8 Apr 2007 19:24:35 +0200 ) [12] => Array ( [subjects] => We cure any desease! ) [13] => Array ( [date] => Sun, 08 Apr 2007 13:21:56 +0100 ) )
No i teraz jak widac 'subject' jest w tablicy o indeksie [0] zas 'date' w tablicy o indeksie [1].
Ja chce natomiast osiagnac taki efekt aby zarowno 'subject' jak i 'date' były w tablicy o indeksie [0], kolejny 'subject' i 'date' w tablicy o indeksie [1] itd......
Teoretycznie daloby sie to zrobic w petli for nadajac te same indeksy w tablicy $part[] ale w tym jest problem ze tablicy $info nie moge nadac indeksu......