public function generateTxtCode($code, $channel, $gift_id, $batch_id) { $txt_file = Config::getTxtOutPutDir() . 'giftcode_' . $channel . '_' . $gift_id . '_' . $batch_id . '.txt'; $code_string = $code; file_put_contents($txt_file, $code_string . "\n", FILE_APPEND); }