PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.9.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.9.4
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / phpoffice / phpspreadsheet / samples / Reading_workbook_data / Properties.php

Properties.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.9.4, at vendor/phpoffice/phpspreadsheet/samples/Reading_workbook_data/Properties.php

65 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use PhpOffice\PhpSpreadsheet\IOFactory;
4
5 require __DIR__ . '/../Header.php';
6
7 $inputFileType = 'Xls';
8 $inputFileName = __DIR__ . '/sampleData/example1.xls';
9
10 // Create a new Reader of the type defined in $inputFileType
11 $reader = IOFactory::createReader($inputFileType);
12 // Load $inputFileName to a PhpSpreadsheet Object
13 $spreadsheet = $reader->load($inputFileName);
14
15 // Read the document's creator property
16 $creator = $spreadsheet->getProperties()->getCreator();
17 $helper->log('<b>Document Creator: </b>' . $creator);
18
19 // Read the Date when the workbook was created (as a PHP timestamp value)
20 $creationDatestamp = $spreadsheet->getProperties()->getCreated();
21 // Format the date and time using the standard PHP date() function
22 $creationDate = date('l, d<\s\up>S</\s\up> F Y', $creationDatestamp);
23 $creationTime = date('g:i A', $creationDatestamp);
24 $helper->log('<b>Created On: </b>' . $creationDate . ' at ' . $creationTime);
25
26 // Read the name of the last person to modify this workbook
27 $modifiedBy = $spreadsheet->getProperties()->getLastModifiedBy();
28 $helper->log('<b>Last Modified By: </b>' . $modifiedBy);
29
30 // Read the Date when the workbook was last modified (as a PHP timestamp value)
31 $modifiedDatestamp = $spreadsheet->getProperties()->getModified();
32 // Format the date and time using the standard PHP date() function
33 $modifiedDate = date('l, d<\s\up>S</\s\up> F Y', $modifiedDatestamp);
34 $modifiedTime = date('g:i A', $modifiedDatestamp);
35 $helper->log('<b>Last Modified On: </b>' . $modifiedDate . ' at ' . $modifiedTime);
36
37 // Read the workbook title property
38 $workbookTitle = $spreadsheet->getProperties()->getTitle();
39 $helper->log('<b>Title: </b>' . $workbookTitle);
40
41 // Read the workbook description property
42 $description = $spreadsheet->getProperties()->getDescription();
43 $helper->log('<b>Description: </b>' . $description);
44
45 // Read the workbook subject property
46 $subject = $spreadsheet->getProperties()->getSubject();
47 $helper->log('<b>Subject: </b>' . $subject);
48
49 // Read the workbook keywords property
50 $keywords = $spreadsheet->getProperties()->getKeywords();
51 $helper->log('<b>Keywords: </b>' . $keywords);
52
53 // Read the workbook category property
54 $category = $spreadsheet->getProperties()->getCategory();
55 $helper->log('<b>Category: </b>' . $category);
56
57 // Read the workbook company property
58 $company = $spreadsheet->getProperties()->getCompany();
59 $helper->log('<b>Company: </b>' . $company);
60
61 // Read the workbook manager property
62 $manager = $spreadsheet->getProperties()->getManager();
63 $helper->log('<b>Manager: </b>' . $manager);
64 $s = new \PhpOffice\PhpSpreadsheet\Helper\Sample();
65