The
XMLWriter::setIndentString() function is an inbuilt function in PHP which is used to set the string which will be used to indent each element/attribute of the resulting xml.
Syntax:
bool XMLWriter::setIndentString( string $indentString )
Parameters: This function accepts a single parameter
$indentString which holds the string to be used as indent.
Return Value: This function returns TRUE on success or FALSE on failure.
Below examples illustrate the
XMLWriter::setIndentString() function in PHP:
Example 1:
Output: Press Ctrl+U to see the XML
👁 Image
Example 2:
Output:
👁 Image