PHP'de Kısa IF-ELSE Yazımı

PHP'de IF-ELSE Kullanımı Örnek;

 

 
<?php
if($isim=='Hoskia){
    echo "Merhaba Hoskia!";
}else{
    header("Location: https://hoskia.com");
}
?>

 


Şimdi yukarıdaki kullanımın PHP'de kısa olarak nasıl yazılacağınzı görelim;
 

PHP'de kısa IF-ELSE Kullanımı Örnek;

 
<? =($isim=='hoskia') ? 'Merhaba Hoskia!' : header("Location: https://hoskia.com"); ?>
  • 0 Users Found This Useful
Was this answer helpful?