Forum


Replies: 1   Views: 728
What is the correct syntax inside an array?
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 martinsimmermann  · 24-05-2022 - 10:29

How do I insert a variable (I don't know if the term is correct) to an list array so that the text inside the array continues from the same line. 

What should be the correct syntax for the $name inside the array?

$docx->createListStyle('Latin', $numberatsioonDisain);

$name = $_POST['name']; // Value comes from HTML form

$myList = array(
    [$name, 'word'], // Value is correct, but "Example text" starts from a new line (with a new list number). But I want the second word to continue from the same line. 
    'Example text.');

$docx->addList($myList, 'Latin');