Mam kilka plikow ktore zawierają w sobie taka tablicę :
Array ( [headers] => Array ( [return-path] => [received] => Array ( [0] => from 129.97.78.23 ([211.202.101.74]) by speedy.uwaterloo.ca (8.12.8/8.12.5) [1] => from 0.144.152.6 by 211.202.101.74; Sun, 08 Apr 2007 19:04:48 +0100 ) [message-id] => [from] => "Tomas Jacobs" [reply-to] => "Tomas Jacobs" [to] => the00@speedy.uwaterloo.ca ---> [subject] => Generic Cialis, branded quality@ [date] => Sun, 08 Apr 2007 21:00:48 +0300 [x-mailer] => Microsoft Outlook Express 6.00.2600.0000 [mime-version] => 1.0 [content-type] => multipart/alternative; boundary="--8896484051606557286" [x-priority] => 3 [x-msmail-priority] => Normal [status] => RO [content-length] => 988 [lines] => 24 ) [starting-pos] => 0 [starting-pos-body] => 772 [ending-pos] => 1761 [ending-pos-body] => 1761 [line-count] => 47 [body-line-count] => 25 [charset] => us-ascii [transfer-encoding] => 8bit [content-boundary] => --8896484051606557286 [content-type] => multipart/alternative [content-base] => / )
Jak widac wyzej zaznaczylem tam [subject] to jest pole do ktorego chce sie dostać
W tym celu stworzylem nastepującą funkcje która wyświetla wszystkie subject z kazdej tablicy z kazdego pliku:
public function getMsgsParts($dir) { $files = $this->getFiles($dir); foreach($slice as $filename) { $mime = mailparse_msg_parse_file($dir.$filename); $struct = mailparse_msg_get_structure($mime); //print_r($struct); foreach($struct as $st) { $section = mailparse_msg_get_part($mime, $st); $info = mailparse_msg_get_part_data($section); $part[] = $info['headers']['subject']; } } return $part; }
Ale niestety cos jest nie tak z tą funkcja powyzej bo dostaje w efekcie jakies puste pola :
Cytat
Array ( [0] => Generic Cialis, branded quality@ [1] => [2] => [R] Confidence-Intervals.... help... [3] => For Smile [4] => [5] => [6] => Less weight - more pleasure and joy [7] => [8] => [9] => Anatrim will change your life [10] => [11] => [12] => problems in animal studies using rats or rabbits feeding outdoor [13] => [14] => [15] => [16] => [17] => We cure any desease! [18] => [19] => [20] => [21] => [22] => Human Growth Hormone [23] => [24] => [25] => hi man [26] => accelerate it does in adults Older adults?Many medicines have not been [27] => [28] => [29] => [30] => [31] => when taken for a long time or in large doses, but it may cause into [32] => [33] => [34] => [35] => [36] => Typo in /debian/README [37] => Re: [R] Confidence-Intervals.... help... [38] => authentic viagra [39] => [40] => [41] => Array ( [0] => Nice talking with ya [1] => Sorry took so long to get this to ya ) [42] => or trembling; stomach cramps; trouble in sleeping; weakness loose [43] => [44] => [45] => [46] => [47] => Which is duty [48] => [49] => [50] => [51] => [52] => For Theorize [53] => [54] => [55] => Theorize get inside for local esc0rts who do it all [56] => [57] => [58] => [59] => )
Jak widac pierwsze pole zostalo uzupelnione poprawnie, ale juz przy [1] jest pusto a powinno byc to co przy [2]. Itd jak widac dalej tez powstaja puste pola. Powinno byc w sumie 20 pol bo tyle mam wlasnie plikow z tablicami. A kazda tablica w pliku zawiera tylko jedno pole [subject].
Co zrobilem nie tak ?
Jak pozbyc sie pustych pol ?
------------------------------------------------------------
Zrobione - temat do zamkniecia