jeudi 1 novembre 2018

My else statement is not echoing the variable

It's written in PHP. My if is working fine, but my else is not echoing. $start and $end are working variables.

   <select name="trip" class="select-trip">
  <?php foreach ( $wp_trips as $trip ) {
    if ($trip->available && $is_day_trip){
         $start = date_i18n("d/m/Y", strtotime($trip->start_date));
         $end = date_i18n("d/m/Y", strtotime($trip->end_date));?>
        <option value="<?php echo $trip->remote_ID; ?>">
        <?php echo $start;
      } else {
          echo $start . ' T/M ' . $end;
      }
    } ?>
  </select>

Aucun commentaire:

Enregistrer un commentaire