Koşullarda elseif Bloğu ile PHP Kodunu Kırma

Ayrıca elseif kullanarak birden fazla koşul oluşturabilirsiniz:

html<?php if ($test === 1) { ?>
  <p>1</p>
<?php } elseif ($test === 2) { ?>
  <p>2</p>
<?php } else { ?>
  <p>?</p>
<?php } ?>

Alternatif sözdizimi ile yeniden yazalım:

html<?php if ($test === 1): ?>
  <p>1</p>
<?php elseif ($test === 2): ?>
  <p>2</p>
<?php else: ?>
  <p>?</p>
<?php endif; ?>
Задание 1

Div'ler verilmiştir:

html<div>
  <p>text1</p>
  <p>text1</p>
  <p>text1</p>
</div>
<div>
  <p>text2</p>
  <p>text2</p>
  <p>text2</p>
</div>
<div>
  <p>text-</p>
  <p>text-</p>
  <p>text-</p>
</div>

Div'lerden birini gösterecek bir koşul yapın.