addProperties

addProperties

BASIC / ADVANCED / PREMIUM

Modifies the spreadsheet properties.

Description
public addProperties($values)

This method modifies the properties of the Excel spreadsheet.

With this method it is possible to modify/add the properties:

  • title
  • subject
  • author (creator)
  • keywords
  • description
  • category
  • created, modified
  • lastModifiedBy
  • revision
  • Manager
  • Company
  • custom properties (name, type and value)

Parameters

values

The possible keys and values of this array are:

Key Type Description
title string The title of the spreadsheet.
subject string The subject of the spreadsheet.
creator string The spreadsheet author or creator.
keywords string A list of keywords that may be separated by any character you wish.
description string The description of the spreadsheet.
category string The category to which you want to associate the spreadsheet.
Manager string The name of the associated Manager.
Company string The company name.
created string The created date (W3CDTF without time zone).
modified string The modified date (W3CDTF without time zone).
lastModifiedBy string The username that modified the spreadsheet.
revision string The revision number.
custom array An array of custom properties. Each entry is composed by the name of the property as key and a value that is itself an array with the type and actual value of the variable.
Code samples

Example #1

The resulting XLSX looks like:

Release notes
  • phpxlsx 1.0:
    • new method.