Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created February 1, 2017 02:18
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 hellofromtonya/fa2ddf9df3efde79324168a0896d8ad3 to your computer and use it in GitHub Desktop.
Save hellofromtonya/fa2ddf9df3efde79324168a0896d8ad3 to your computer and use it in GitHub Desktop.
Code Challenge if/elseif/else
<?php
$post_id = 10;
$image_size = 'thumbnail';
if ( $image_size == 'full' || $post_id < 5 ) {
// run the if code block
} elseif ( $image_size == 'thumbnail' && $post_id == 10 ) {
// run the elseif code block
} else {
// do the else code block.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment