This is what I have so far, and it works as far as linking the footnotes, but how should I process the HTML?
.............
$docx = new CreateDocx();
$mytext = 'The quick <em>brown fox</em>[fn] jumped over the lazy <strong>sleeping dog</strong>.[fn] And the story continues...';
$footnotes = 'footnote for the italicized brown fox~~footnote for the bolded sleeping dog~~';
$artext = explode('[fn]', $mytext);
$arfoot = explode('~~', $footnotes);
$text = array();
for ($ni=0;$ni<sizeof($artext);$ni++) {
if($arfoot[$ni]!=''){
$tmp = new WordFragment($docx, 'document');
$tmp->addFootnote(
array(
'textDocument' => $artext[$ni],
'textFootnote' => $arfoot[$ni],
)
);
}else{
$tmp = array('text' => $artext[$ni]);
}
$text[] = $tmp;
}
$docx->addText($text);
$docx->createDocxAndDownload('mySample');
Thanks.