Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php use PhpOffice\PhpSpreadsheet\Spreadsheet; require __DIR__ . '/../Header.php'; $ca..
Decoded Output download
<?php
use PhpOffice\PhpSpreadsheet\Spreadsheet;
require __DIR__ . '/../Header.php';
$category = 'Date/Time';
$functionName = 'EDATE';
$description = 'Returns the serial number that represents the date that is the indicated number of months before or after a specified date';
$helper->titles($category, $functionName, $description);
// Create new PhpSpreadsheet object
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
$months = range(-12, 12);
$testDateCount = count($months);
for ($row = 1; $row <= $testDateCount; ++$row) {
$worksheet->setCellValue('A' . $row, '=DATE(2020,12,31)');
$worksheet->setCellValue('B' . $row, '=A' . $row);
$worksheet->setCellValue('C' . $row, $months[$row - 1]);
$worksheet->setCellValue('D' . $row, '=EDATE(B' . $row . ', C' . $row . ')');
}
$worksheet->getStyle('B1:B' . $testDateCount)
->getNumberFormat()
->setFormatCode('yyyy-mm-dd');
$worksheet->getStyle('D1:D' . $testDateCount)
->getNumberFormat()
->setFormatCode('yyyy-mm-dd');
// Test the formulae
for ($row = 1; $row <= $testDateCount; ++$row) {
/** @var null|bool|float|int|string */
$calc = $worksheet->getCell('D' . $row)->getCalculatedValue();
$helper->log(
$worksheet->getCell('B' . $row)->getFormattedValue()
. ' and '
. $worksheet->getCell('C' . $row)->getFormattedValue()
. ' months is '
. $worksheet->getCell('D' . $row)->getCalculatedValue()
. ' ('
. $worksheet->getCell('D' . $row)->getFormattedValue()
. ')'
);
}
?>
Did this file decode correctly?
Original Code
<?php
use PhpOffice\PhpSpreadsheet\Spreadsheet;
require __DIR__ . '/../Header.php';
$category = 'Date/Time';
$functionName = 'EDATE';
$description = 'Returns the serial number that represents the date that is the indicated number of months before or after a specified date';
$helper->titles($category, $functionName, $description);
// Create new PhpSpreadsheet object
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
$months = range(-12, 12);
$testDateCount = count($months);
for ($row = 1; $row <= $testDateCount; ++$row) {
$worksheet->setCellValue('A' . $row, '=DATE(2020,12,31)');
$worksheet->setCellValue('B' . $row, '=A' . $row);
$worksheet->setCellValue('C' . $row, $months[$row - 1]);
$worksheet->setCellValue('D' . $row, '=EDATE(B' . $row . ', C' . $row . ')');
}
$worksheet->getStyle('B1:B' . $testDateCount)
->getNumberFormat()
->setFormatCode('yyyy-mm-dd');
$worksheet->getStyle('D1:D' . $testDateCount)
->getNumberFormat()
->setFormatCode('yyyy-mm-dd');
// Test the formulae
for ($row = 1; $row <= $testDateCount; ++$row) {
/** @var null|bool|float|int|string */
$calc = $worksheet->getCell('D' . $row)->getCalculatedValue();
$helper->log(
$worksheet->getCell('B' . $row)->getFormattedValue()
. ' and '
. $worksheet->getCell('C' . $row)->getFormattedValue()
. ' months is '
. $worksheet->getCell('D' . $row)->getCalculatedValue()
. ' ('
. $worksheet->getCell('D' . $row)->getFormattedValue()
. ')'
);
}
Function Calls
None |
Stats
MD5 | c1c82323c401d2d86871dfe387190fe4 |
Eval Count | 0 |
Decode Time | 86 ms |