Bir sonuç için bir php fonksiyonu sınırlayabilir [kapalı]

1 Cevap php

Sadece bana bir sonuç verir böylece nasıl bu sorgu sınırlamak olur?

Kod:

function next_prodn_header() {

    $StartDate = get('start_date');
    $timestamp = strtotime($StartDate);

    $EndDate = get('end_date');
    $Now = strtotime(date('d-m-Y'));
    $Start = strtotime($EndDate); 
    $newStart = date_i18n('d-m-Y', $Start);

    if ($Now <= $Start) {

 for ($i = 1; $i < 1; $i++) {
     echo "<h2>Next Event</h2>";
     echo "<span class=\"month\">";
     echo date_i18n('M', $timestamp);
     echo "</span>\n";
     echo "<span class=\"year\">";
     echo date_i18n('Y', $timestamp);
     echo "</span>\n\t\t";
     echo "<p><a href='";
     echo the_permalink();
     echo "' title='";
     echo the_title();
     echo "'>";
     echo the_title();
     echo "</a></p>\n\t\t";
     }
    } else {
  echo "";
    }
}

1 Cevap

query sizin for döngü anlamına göre ise, $i = 0 de döngü başlar. Şu an itibariyle, sizin için döngü yapısı kontroller 1 < 1 yanlış değerlendirilirse hangi eğer, bu yüzden döngü içinde kod çalışmaz.

Aksi takdirde, ben soru ile ilgili ne tam olarak emin değilim.