本文整理汇总了PHP中FileData::GetOddNumbers方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::GetOddNumbers方法的具体用法?PHP FileData::GetOddNumbers怎么用?PHP FileData::GetOddNumbers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileData
的用法示例。
在下文中一共展示了FileData::GetOddNumbers方法的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();