To read and replace content from Doc file, you can use PHPWord package and download this package using composer command: 1) Open document 2) Replace string variables for single 3) Replace string variables for multi occurrence – Replace variable value…