searchAndReplace

searchAndReplace

PREMIUM TRIAL / ADVANCED

Searches and replaces text strings in a PowerPoint document.

Description
public searchAndReplace (string $source, string $target, array $data, [, array $options])

This method allows the substitution of text strings in a PPTX document.

Parameters

source

The path to the source Word document.

target

The path to the Word document resulting after the text replacement.

data

Strings to be searched and replaced.

options

The possible keys and values are:

Key Type Description
slideNumber int Slide number to replace the value. All if null.
Code samples

Example #1

Release notes
  • phpdocx 12.5:
    • replace parts of string contents.
  • phpdocx 8.5:
    • new method.