removeWordContent
- addBibliography
- addBookmark
- addBreak
- addCaption
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addIndex
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addRuby
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableAuthorities
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- markEntry
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- importTheme
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
removeWordContent
 ADVANCED / PREMIUM
ADVANCED / PREMIUM
                     TRIAL
TRIAL
                Removes contents in the document.
                            
                            Description
                        
                    
                            public removeWordContent (array $referenceNode)
                        
                    
                            
                            Parameters
                        
                    referenceNode
                                An array to get the refence node.
                                The possible keys and values of this array are:
                            
| Key | Type | Description | 
|---|---|---|
| type | string | 
 | 
| contains | string | Contains a text string. | 
| occurrence | mixed | 
 | 
| attributes | array | Contains a specific attribute key and value. | 
| parent | string | Main document body as default, allows to set any parent or a specific one. w:body (default), '/' (any parent) or any other specific parent (/w:tbl/, /w:tc/, /w:r/...). | 
| target | string | 
 | 
| reference | array | To be used with header and footer targets: positions (array) 1, 2... based on the sectPr contents order, sections (array) 1, 2..., types (array) first, even, default | 
| customQuery | string | Custom xpath query, overwrites any other reference. | 
                            
                            Exceptions
                        
                    Method not available.
                            
                            Code samples
                        
                    Example #1
                            
                            Release notes
                        
                    - phpdocx 17.0:
                                    - occurrence option allows setting an array.
- improved working with header and footer targets when the document include sections without headers or footers.
 
- phpdocx 15.5:
                                    - math type.
 
- phpdocx 15.0:
                                    - table-row, table-cell and table-cell-paragraph types.
 
- phpdocx 14.5:
                                    - removed a PHP Warning when all body contents are deleted using PHP 8.
 
- phpdocx 12.0:
                                    - improved working with multiple sections that contain multiple headers and footers.
 
- phpdocx 9.5:
                                    - header and footer targets.
 
- phpdocx 7.0:
                                    - range of elements, iterate all elements not only the first one, siblings.
 
- phpdocx 6.0:
                                    - new method.
 
 
                 Log in
                                    Log in
                                 Contact
                                Contact
                             Forum
                                Forum
                            
