Last active
December 4, 2015 17:08
-
-
Save k7y6t5/1d9975d2777df106ef65 to your computer and use it in GitHub Desktop.
All your intership are belong to us
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_catchphrases() { | |
$catchphrases = array( | |
'progressive-enhancement', | |
'semantic-markup', | |
'mobile-first-development', | |
); | |
$catchphrases = implode(', ', $catchphrases); | |
$catchphrases = substr_replace($catchphrases, ", and ", strrpos($catchphrases, ", "), strlen(", ")); | |
return $catchphrases; | |
} | |
function recognize($headphones) { | |
return $headphones ? "yes" : "no"; | |
} | |
function friends() { | |
$friends = array( | |
'the internet', | |
'a cat', | |
'HTML', | |
'coffee', | |
'CSS', | |
'JavaScript', | |
); | |
$count = count($friends); | |
$index = rand(0, $count); | |
return $friends[$index]; | |
} | |
?> | |
<p> | |
Your catchphrases are <?php echo get_catchphrases(); ?>. | |
</p> | |
<p> | |
<?php $headphones_on = false; ?> | |
<strong>Q</strong>: You're <?php echo $headphones_on ? "" : "not"; ?> wearing headphones. Do people recognize you?<br> | |
<strong>A</strong>: <?php echo ucfirst(recognize($headphones_on)); ?> | |
</p> | |
<p> | |
Your best friend is <?php echo friends() ?>. | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment