0

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!

4
  • 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 ... Commented Jan 23, 2013 at 14:12
  • Okay. Sure... will modify the original question Commented Jan 23, 2013 at 14:13
  • okay. loops added. Not sure at all but it's a start. Commented Jan 23, 2013 at 14:32
  • Never mind. Will re-do the code and then may be post againn Commented Jan 23, 2013 at 21:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.