in PHP, I'm considering doing something like this:

```
function foo(){
echo 'bar';
}

$fn = 'foo';

$fn();

```

It works, but is it considered bad practice?

I have an multidimensional array of elements that each have a corresponding function. I would like to store that function name, and call the corresponding functions for each element when traversing the array.

something like:

```
function render_el1(){ echo 'et';}
function render_el2(){ echo 'to';}

$elements = array(
    'el_1' => array(
        'name' => 'Element One'
    ,   'func' => 'render_el1'
    )
,   'el_2' => array(
        'name' => 'Element Two'
    ,   'func' => 'render_el2'
    )
);

foreach($elements as $element => $options){
    $fn = $options['func'];

    echo '<h1>'.$options['name'].'</h1>';

    if (function_exists($fn)) {
        $fn();
    }
}

```

Any comments to this approach is highly welcome, and I'd also like to know what this method is called in programming terms.