Hi all,
I have a script which holds a funcation which I need to change the name of dynamically. I need to change the name "myRecordHandler" in the funcation name to the content of the "$fileFlag". I have been messing with this all day with no results. Can any one help.
$fileCount = 0;
while($fileCount < 2)
{
if($fileCount == 0){
$xmlFile = "lhr_d.txt";
$fileFlag = "depart";
}elseif($fileCount == 1){
$xmlFile = "lhr_a.txt";
$fileFlag = "arrive";
}
function myRecordHandler($record)
{
// do whatever
}
$result = MagicParser_parse("/var/www/vhosts/mydomain.com/httpdocs/xml/" . $xmlFile ." ","" . $fileFlag . ""","xml|RESULTS/FLIGHT/");
$fileCount = $fileCount+1;
}