本文整理匯總了PHP中FileData::GetEvenNumbers方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileData::GetEvenNumbers方法的具體用法?PHP FileData::GetEvenNumbers怎麽用?PHP FileData::GetEvenNumbers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileData
的用法示例。
在下文中一共展示了FileData::GetEvenNumbers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
<?php
require_once "Math.php";
require_once "File.php";
$job = !isset($_REQUEST["job"]) ? '' : trim($_REQUEST["job"]);
$evenNumbers = array();
$oddNumbers = array();
$fiboNumbers = array();
$file = array();
if ($job == "uploadFile") {
$file = new FileData($_FILES["aNumbers"]);
//assign data from file to $file object
//get even, odd and fibonacci numbers from file and store in respective arrays
$evenNumbers = $file->GetEvenNumbers();
$oddNumbers = $file->GetOddNumbers();
$fiboNumbers = $file->GetFibonacciNumbers();
if (!isset($_SESSION['file'])) {
$_SESSION['file'] = $file;
}
}
$job = !isset($_GET["job"]) ? '' : trim($_GET["job"]);
if ($job == "exportnumbers") {
//If a valid file was submitted with the submit button, then its details are saved in a session
if (isset($_SESSION['file'])) {
$file = $_SESSION['file'];
$file->ExportNumbers($_SESSION["filename"] . ".csv");
//call ExportNumbers function using the filename stored in a session and adding .csv as an extension
}
}
if ($job == "reset") {
session_destroy();