R
R
ryzhak2015-09-02 12:42:37
PHP
ryzhak, 2015-09-02 12:42:37

How to change the value of a variable in PHPExcel, not a specific cell?

For example, in Word, you can create a test.docx document with the following content:

Имя: ${name}
Фамилия: ${second_name}
Отчество: ${third_name}

And then on the server, using PHPWord, insert the necessary variables instead of these placeholders:
$phpWord = new PHPWord();
$template = $phpWord->loadTemplate("test.docx");
$template->setValue("name", "Ivan");
$template->setValue("second_name", "Ivanov");
$template->setValue("third_name", "Ivanovich");
$template->saveAs("newtest.docx");

How to do the same in excel? To manually insert the necessary variables (placeholders) into the document and then change them on the server? Is it possible?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question