I am trying to loop through an array using foreach loops and for each elements I want to create a separate function.
$items = ['one', 'two', 'three'];
foreach( $items as $item ){
function $item."_output"(){
echo $item.' success';
}
}
My expectation is to create function for each array element like:
function one_output(){}, function two_output(){}, function three_output(){}