title: php pdo code to append no with date
body: <p><strong>column name</strong></p>
  
  <p>coupon</p>
  
  <p>coupondate</p>
  
  <p>startingdate</p>
  
  <p>I am generating coupondate based on coupon and startingdate.</p>
  
  <p><strong>FOR EX -</strong> </p>
  
  <p>if coupon  =   500,501 and startingdate = 24-02-2015</p>
  
  <p>then coupondate generates like below..</p>
  
  <p>coupondate = 23-03-2015,23-04-2015</p>
  
  <p><strong>But I need to append coupon with coupondate</strong></p>
  
  <p><strong>FOR EX -</strong> </p>
  
  <p>500 - 23-03-2015</p>
  
  <p>501 - 23-04-2015 like wise..</p>
  
  <p>plz help to get above output</p>
  
  <p>below is my code</p>
  
  <pre><code>$coupon = $_POST['coupon'];                         
                      $startingdate = $_POST['startingdate'];                         
                      $coupons = explode(',', $coupon);                       
                      $dates = Array();
                      for ($no = 1; $no &lt; count($coupons) + 1; $no++) 
                      {
                      $dates[] = date("d-m-Y", strtotime($startingdate . " +" . $no . " MONTHS -1 DAYS"));                        
                      }                       
                      $coupondate = implode(',', $dates); 
  </code></pre>