This project is read-only.

Duplicate Part of an document

Jun 22, 2013 at 8:24 AM
hi! I'm trying to create a code to duplicate a part of the template. For this I was inspired a code that duplicates table rows.

Basically use [0] at the beginning and end of the content that I want to duplicate, it actually copies the part you want, the problem is that the syntax error in the document, can someone tell me how to solve this?
public function clonePart($search, $numberOfClones){
        $string = $this->_documentXML;
        $valor = '';
        for ($i = 1; $i <= $numberOfClones; $i++) {
         $valor .= preg_replace("/.*\[\d+](.*)\[\d+].*/", "$1", $string, 1);
        $this->_documentXML =  htmlspecialchars($valor);
        echo $valor;
Jun 26, 2013 at 3:04 PM