Skip to content

Instantly share code, notes, and snippets.

@kylekatarnls
Last active August 2, 2019 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylekatarnls/061060b95a0e62ed4c14a1f799e9f53d to your computer and use it in GitHub Desktop.
Save kylekatarnls/061060b95a0e62ed4c14a1f799e9f53d to your computer and use it in GitHub Desktop.
If else
<?php
function getWaterState($degrees)
{
if ($degrees < 0) {
return 'This is solid ice';
} elseif ($degrees > 100) {
return 'This is gaz water';
} else {
return 'This is liquid water';
}
}
<?php
function getWaterState($degrees)
{
if ($degrees < 0) {
return 'This is solid ice';
}
if ($degrees > 100) {
return 'This is gaz water';
}
return 'This is liquid water';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment