I am attempting to run a function named from a variable. There is no syntax error. Temperature is not returned. I don't know for certain if the problem is with the function itself or the eval. Variations on the eval theme have not worked so far.

```
function getBtemp($lum, $sub){
    $tempsB = array(
         "V" => array( 30000, 25400, ... ),
         "III" => array( 29000, 24000, ... ),
         "I" => array( 26000, 20800, ... ) );
    if($lum == "VI"){ $lum = "V"; }
    else if($lum == "IV"){ $lum = "III"; }
    else if($lum == "II" || $lum == "Ib" || $lum == "Ia" ){ $lum = "V"; }
    return $tempsB['$lum']['$sub']; }

// Variables:

$spectralclass = "B";
$luminosityclass = "V";
$subclass = 5;

// Needed:

$temp = getBtemp($luminosityclass, $subclass);

// Functions are named from spectral class, e.g. get.$spectralclass.temp()
// Attempt:

$str = "$temp = get".$spectralclass."temp($luminosityclass, $subclass);";
eval($str);

```