Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
Forked from ericandrewlewis/gist:2969986
Last active December 22, 2015 00:39
Show Gist options
  • Save bondarewicz/6390981 to your computer and use it in GitHub Desktop.
Save bondarewicz/6390981 to your computer and use it in GitHub Desktop.
<?php
function pretty($elem, $class, $func_name) {
echo '<'. $elem.' class="' . $class . '">';
call_user_func($func_name);
echo '</'.$elem.'>';
}
function main_page() {
echo 'This is the main page';
}
$elems = array('div', 'span', 'p');
foreach($elems as $e) {
pretty($e, 'main', 'main_page');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment