Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have three arrays. They are all index based arrays [0], [1]... They are:

$array_userinfo[login][email]
$array_userallmeetingfoldersco[login,folder-id]
$array_expiredmeetingscos[sco-id,folder-id,name,date-modified,date-end

$array_userinfo 's first element (login) matches $array_userallmeetingfoldersco 's first element (login). In turn, $array_expiredmeetingssco 's second element (folder-id).

What I need to achieve is that IF array_userinfo's 'login' is found inside $array_userallmeetingfoldersco's 'login' then find any matching 'folder-id' between $array_userallmeetingfoldersco and $array_expiredmeetingscos and, if found, send email only once to the 'email' address of $array_userinfo; the email ideally includes 'name', 'date-modified', 'date-end' fields from $array_expiredmeetingscos array.

Update: Code for loops added

foreach($array_userinfo as $userInfo) {//user logins; make this into easy to search
 $checkAgainstLogins[$userInfo[0]] = $userInfo[1];//0 is login, 1 is email
}

foreach($array_expiredmeetingscos as $expiredMeetings) {//expired meetings. make this into easy to search
$checkAgainstExpiredMeetings[$expiredMeetings[1]] = $expiredMeetings[2];//1 is folder-id, 2 is name
}

//loops for email follow
foreach($array_userallmeetingfoldersco as $matchingLogins) {
  if(isset($checkAgainstLogins[$matchingLogins])) {//login matched. Now find matching 'folder-id'
   foreach($array_expiredmeetingscos as $matchingFolderID) {
     if(isset($checkAgainstExpiredMeetings[$matchingFolderID])) {//folder-id matched
     //add to some array of expired Meetings? then email?
     }
   }
}

}

So loop within loop but the complicating factor is to send email only once. Any code to share? Thanks!

share|improve this question
1  
Code to share? This is not a sharing code website. You actually have to try something and someone will point your errors and what you can do better. But at least show you tried ... – Mihai Iorga Jan 23 at 14:12
Okay. Sure... will modify the original question – Meengla Jan 23 at 14:13
okay. loops added. Not sure at all but it's a start. – Meengla Jan 23 at 14:32
I am stuck! Any idea? – Meengla Jan 23 at 21:05
Never mind. Will re-do the code and then may be post againn – Meengla Jan 23 at 21:22

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.