0

So the following code:

$csv_reader = PHPExcel_IOFactory::createReader("CSV");
$temp = rand();
echo $temp;
echo "<br/>";
$php_excel = $csv_reader->load("foo.csv");
echo $temp;

Outputs this (as expected):

207192412
207192412

Whereas the following code:

$csv_reader = PHPExcel_IOFactory::createReader("CSV");
$temp = microtime(true);
echo $temp;
echo "<br/>";
$php_excel = $csv_reader->load("foo.csv");
echo $temp;

Outputs this:

1431775661.6455
1431775661.645471

Why does $temp change? I tried using other random variables names, like $nggyu, and I still get the same issue.

What gives?

(Using PHPExcel version 1.81, on Ubuntu 12.04, with PHP 5.3.10)

Kosta Kontos
  • 4,152
  • 7
  • 25
  • 28

1 Answers1

0

I tried your code on my system

<?php 
include 'PHPExcel.php';
$csv_reader = PHPExcel_IOFactory::createReader("CSV");
$temp = microtime(true);
echo $temp;
echo "<br/>";
$php_excel = $csv_reader->load("foo.csv");
echo $temp;

?>

Output :

1431798431.3535
1431798431.3535

(Using PHPExcel version 1.80, on Windows 7, with PHP 5.5.6)

Sashant Pardeshi
  • 1,075
  • 7
  • 21