Skip to content

Instantly share code, notes, and snippets.

@k7y6t5
Last active December 4, 2015 17:08
Show Gist options
  • Save k7y6t5/1d9975d2777df106ef65 to your computer and use it in GitHub Desktop.
Save k7y6t5/1d9975d2777df106ef65 to your computer and use it in GitHub Desktop.
All your intership are belong to us
<?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