I have this array:
$methodsOutput = array("MidUpperArmMuscleArea","ArmSpan_HeightEstimation","BMIBeforePregnancy",
"PregnancyTotalWeightGain","PregnancyWeeklyWeightGain","MS_CurrentBMI_BMIPregnancyWeeks",
"PregnancyDueDate","PregnancyWeeks","WeightEstimation","WHO_BMI_2000_IdealBMI",
"WHO_BMI_2000_IdealWeight","WHO_HeightAge_2006_IdealHeight","WHO_WeightAge_2006_IdealWeight");
and for each one I have the respective class (all included in file).
How can I instantiate dynamically this.
I try this:
foreach($methodsOutput as $method) {
$$method= new $method();
}
but get:
Fatal error: Class 'MidUpperArmMuscleArea' not found in...
Class '...' not foundthen the class is not found. No way around it. If you think the class should be found, then test your assumption to be correct.