fork download
  1. <?php
  2.  
  3. $voucher='<div>VOUCHER IMAGE COMES HERE</div>';//only group for voucher must see it
  4. $mail_description='Here comes my mail text';
  5. $voucherarray=array("mail1@gmail.com","mail3@gmail.com");
  6. $mailaray=array("mail1@gmail.com","mail2@gmail.com");
  7. $html='';
  8. foreach($mailaray as $email){
  9. $html.='<div>'.$mail_description.'</div>';
  10.  
  11. if(in_array($email, $voucherarray)){
  12. $html.=$voucher;
  13. echo $email.'is for voucher';
  14. }
  15. else {
  16. $email.'is not for voucher';
  17. }
  18. $html.='<table><tr><td></td></tr></table><div clss="footer"></div>';
  19. }
  20. echo $html.'<br />';
  21.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
mail1@gmail.comis for voucher<div>Here comes my mail text</div><div>VOUCHER IMAGE COMES HERE</div><table><tr><td></td></tr></table><div clss="footer"></div><div>Here comes my mail text</div><table><tr><td></td></tr></table><div clss="footer"></div><br />