if, elseif & switch (PHP)
Në shqip: Kushtet në PHP
ShpjegimiSQ
PHP-ja i ka kushtet si gjuhët e tjera: if, elseif, else dhe switch. Në template HTML shpesh përdoret sintaksa alternative if: ... endif; që lexohet më mirë mes etiketave.
EnglishEN
PHP has conditions like other languages: if, elseif, else and switch. In HTML templates the alternative syntax if: ... endif; is often used because it reads better between tags.
Si ta mendosh
Si mësuesja që vendos notën sipas pikëve.
Lexoje në anglisht
Like a teacher deciding the grade by points.
Shembull kodiphp
<?php if ($nota >= 5): ?>
<p>Shkëlqyeshëm!</p>
<?php elseif ($nota >= 2): ?>
<p>Kaloi</p>
<?php endif; ?>