Conditional Statement (Mistake 1)

Refer to the following codes:

  1. <?php
  2. $n = "UniSZA";
  3. if ($n = "UMT")
  4. {
  5. echo "UMT is Universiti Malaysia Terengganu";
  6. }
  7. else if ($n == "UniSZA")
  8. {
  9. echo "UniSZA is Universiti Sultan Zainal Abidin";
  10. }
  11. ?>

Post your comments why the result is not correctly displayed as "UniSZA is Universiti Sultan Zainal Abidin".


Diperbaharui kali terakhir: Saturday, 23 February 2019, 10:10 AM