want to get the php executable result? : I have two files name test.txt that will contains the template code  i need to evalute this template according to the php..I tried to evalute it using php eval() function but cant get the result ...thanks in advance

test.txt

    @$firmware_path=true;
    @$DIALPLAN=1312321;
    @$MAX_LINES=3;
    @$data=array();
    @$OPERATOR_IP='';
    @$enabled=true;
    @ if ($firmware_path) 
    @{
        firmware server: http://{$OPERATOR_IP}{$firmware_path}
    @ }
    
    
    
    @ for ($i = 1; $i <= $MAX_LINES; $i++)
    @ {
    	@ $enabled = isset($LINES[$i - 1]);
    	@ if ($enabled) 
        @{
    		@ $data = $LINES[$i -1];
    		
    		@ if ($data['USER_FULLNAME']) 
            @{
    			@ if ($PHONE_LABEL) 
                @{
    				@ $screenName = $data['USER_FULLNAME'] . ' ' . $data['TELNUM'];
    				@ $screenName2 = $PHONE_LABEL;
    			@ } 
                @else 
                @{
    				@ $screenName = $data['USER_FULLNAME'];
    				@ $screenName2 = $data['TELNUM'];
    			@ }
    		@ } 
            @else 
            @{
    			@ $screenName = $data['TELNUM'];
    			@ $screenName2 = $PHONE_LABEL;
    		@ }
    
    	@ }
    @ }


index.php

    <?php
    
    $file = fopen("test.txt","r");
    $arr=array();
    while(! feof($file))
    {
      $arr[]=fgets($file);
    }
    
    
    $format='';
    foreach($arr as $key=>$value)
    {
      if(substr(ltrim($value), 0, 1) === '@')
      {
        $result=str_replace('@','',$value);
    
        $format.=$result.PHP_EOL;
    
      }
      else
      {
    
        $format.='$final="'.$value.'";';
      }
      
    }
      
    
     $format.=' return $final;';
    echo eval($format);
    
    
    ?>

the result should be generated according to php