Jump to content

variable function names?


blueman378

Recommended Posts

Hmm technically it is but you need to have a variable value that matches a function with the name,

 

<?php
function foo() {
    echo "In foo()<br />\n";
}

$func = 'foo';
$func();        // This calls foo()

 

Its not an area I am brilliant at but its in the manual under functions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.