Forum


Replies: 4   Views: 2837
Dynamic table
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 28-03-2017 - 18:30

Hello,

You need to use a string separated by '\n'. For example:

$multiline = 'This is the first line.\nThis is the second line of text.';
$variables = array('MULTILINETEXT' => $multiline);
$options = array('parseLineBreaks' =>true);
$docx->replaceVariableByText($variables, $options);

If you have an array with data, you can join it with '\n' :

$string_data = implode('\n', $array);
$variable = array('VAR_DATA' => $multiline););
$docx->replaceVariableByText($variable, array('parseLineBreaks' =>true));

Regards.