Skip to content

Instantly share code, notes, and snippets.

@wichaksono
Created March 9, 2018 12:47
Show Gist options
  • Save wichaksono/3ed51bb5ef57b23956ce7c0c2a28d5db to your computer and use it in GitHub Desktop.
Save wichaksono/3ed51bb5ef57b23956ce7c0c2a28d5db to your computer and use it in GitHub Desktop.
<?php
if ( $a == '' ) { // jika $a kosong
echo 'nilai a tidak boleh kosong';
} else if($b == '' ) { // if kedua akan dijalankan ketika if pertama menyatakan bahwa $a memiliki nilai. disini kita akan mengechek nilai b, berisi / tidak
echo 'nilai b tidak boleh kosong';
} else if ( $a &gt; $b ) {
echo 'benar';
} else {
echo 'salah';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment