SORU
6 Aralık 2010, PAZARTESİ


Kır arasındaki fark ve PHP devam mı?

PHP break continue arasındaki fark nedir?

CEVAP
6 Aralık 2010, PAZARTESİ


break tamamen bir döngü, continue sadece geçerli yineleme kısayolları biter ve bir sonraki yinelemeye geçer.

while ($foo) {   <--------------------┐
    continue;    --- goes back here --┘
    break;       ----- jumps here ----┐
}                                     |
                 <--------------------┘

Bu gibi kullanılacaktır:

while ($droid = searchDroids()) {
    if ($droid != $theDroidYoureLookingFor) {
        continue; // ..the search with the next droid
    }

    $foundDroidYoureLookingFor = true;
    break; // ..off the search
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:
Php

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Android Police

    Android Poli

    21 NİSAN 2010
  • Metheud

    Metheud

    9 EYLÜL 2006
  • Schmittastic Jr.

    Schmittastic

    19 Mart 2013