本文整理汇总了PHP中LimeExpressionManager::TSVSurveyExport方法的典型用法代码示例。如果您正苦于以下问题:PHP LimeExpressionManager::TSVSurveyExport方法的具体用法?PHP LimeExpressionManager::TSVSurveyExport怎么用?PHP LimeExpressionManager::TSVSurveyExport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LimeExpressionManager
的用法示例。
在下文中一共展示了LimeExpressionManager::TSVSurveyExport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _exporttsv
/**
* Generate an TSV (tab-separated value) file for the survey structure
* @param type $surveyid
*/
private function _exporttsv($surveyid)
{
$fn = "limesurvey_survey_{$surveyid}.txt";
header("Content-Type: text/tab-separated-values charset=UTF-8");
header("Content-Disposition: attachment; filename={$fn}");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
// HTTP/1.0
$data =& LimeExpressionManager::TSVSurveyExport($surveyid);
$lines = array();
foreach ($data as $row) {
$lines[] = implode("\t", str_replace(array("\t", "\n", "\r"), array(" ", " ", " "), $row));
}
$output = implode("\n", $lines);
// echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $output;
return;
}