Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP example on variable variables - without needing them
<?php
function bar($a, $b, $c) {
$r = new ReflectionFunction(__FUNCTION__);
$params = func_get_args();
$form = array();
foreach ($r->getParameters() as $param) {
$form[$param->getName()] = array(
'#type' => 'hidden',
'#value' => $params[$param->getPosition()],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.