Is there any method to write different color of text in a same line like this but it change whole line color?
Here is my code:
$section->addText( 'Headline: ', (array('color'=>'#70AD47')),$fontStyleIndexPara);
$section->addText(cleanstring($data[$k]['ArticleTitle']),$fontStyleIndexPara);
`
Instead of writing the individual text parts directly into the section with addText(), enclose it with addTextRun().
By using addTextRun() you can prevent the line break.
Code for your example:
$TextRun = $section->addTextRun();
$TextRun->addText( 'Headline: ', array('color'=>'70AD47'));
$TextRun->addText(cleanstring($data[$k]['ArticleTitle']));
The # is not used for the color.