当前位置: 首页>>代码示例>>PHP>>正文


PHP ImportFromCSV函数代码示例

本文整理汇总了PHP中ImportFromCSV函数的典型用法代码示例。如果您正苦于以下问题:PHP ImportFromCSV函数的具体用法?PHP ImportFromCSV怎么用?PHP ImportFromCSV使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ImportFromCSV函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postvalue

if (@$_POST["a"] == "added") {
    $value = postvalue("value_ImportFileName" . $id);
    $type = postvalue("type_ImportFileName" . $id);
    $importfile = getImportTableName("file_ImportFileName" . $id);
    //check the file extension
    $pos = strrpos($value, ".");
    $ext = strtoupper(substr($value, $pos));
    if ($eventObj->exists('BeforeImport')) {
        if ($eventObj->BeforeImport() === false) {
            exit(0);
        }
    }
    if ($ext == ".XLS" || $ext == ".XLSX") {
        ImportFromExcel($importfile);
    } else {
        ImportFromCSV($importfile);
    }
    if ($eventObj->exists('AfterImport')) {
        $eventObj->AfterImport($goodlines, $total_records - $goodlines);
    }
    if ($goodlines == $total_records) {
        $error_message = "<font size=2>" . $goodlines . " records were imported</font><br>";
        $error_message .= "<font size=2>To back to your list click on the <b>Back to list</b> button.</font>";
    } else {
        $error_message .= "Number of records: " . $total_records . "<br>";
        $error_message .= "Imported: " . $goodlines . "<br>";
        $error_message .= "Not imported: ";
        $error_message .= $total_records - $goodlines . "<br>";
    }
}
include 'include/xtempl.php';
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:Readings_import.php

示例2: if

	
	
	if ($eventObj->exists('BeforeImport'))
	{
		if ($eventObj->BeforeImport($pageObject) === false)
		{
			exit(0);
		}
	}
	if($ext==".XLS" || $ext==".XLSX")
	{
		ImportFromExcel($importfile, $strOriginalTableName, $ext, $keys, $keys_present, $total_records, $error_message, $goodlines, $pageObject, $cipherer);
	}	
	else 
	{
		ImportFromCSV($importfile, $strOriginalTableName, $ext, $keys, $keys_present, $total_records, $error_message, $goodlines, $pageObject, $cipherer);
	}	
	
	if($message != "")  // if error happened in ImportFromExcel or ImportFromCSV
	{
		$error_message .= "<br>".$message."<br><br>";
	}
	else if ($eventObj->exists('AfterImport'))
	{
		$eventObj->AfterImport($goodlines, $total_records-$goodlines, $pageObject);
	}
	
	if ($goodlines==$total_records)
	{
		$error_message .= "<font size=2>" . $goodlines . " records were imported</font><br>";
		$error_message .= "<font size=2>To back to your list click on the <b>Back to list</b> button.</font>";
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:29,代码来源:webreport_users_import.php


注:本文中的ImportFromCSV函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。