I have few php functions that returns various data via same variable, and that variable should assign to a array. Now I want to execute function by checking $_POST and assign $data to $response multidimensional array... Is there any way to do that ???
$functionname = $_POST['functionname'];
function testOne(){
$data = array('test'=>'value1');
return $data;
}
function testTwo(){
$data = array('test'=>'value2');
return $data;
}
//Here I need to execte each functions and return $data
$response = array('result' => array('response'=>'success'),'clients' => $data);
print_r($response);
$data = $functioname()? If so, that is a very insecure way of writing code.