XMLWriter::setIndent

xmlwriter_set_indent

(PHP 5 >= 5.1.2, PHP 7, PECL xmlwriter >= 0.1.0)

XMLWriter::setIndent -- xmlwriter_set_indentToggle indentation on/off

설명

객체 기반 형식

bool XMLWriter::setIndent ( bool $indent )

절차식 형식

bool xmlwriter_set_indent ( resource $xmlwriter , bool $indent )

Toggles indentation on or off.

인수

xmlwriter

순차적 호출에서만 사용. XMLWriter resource가 수정됩니다. 이 자원은 xmlwriter_open_uri()xmlwriter_open_memory() 호출로 만들어집니다.

indent

Whether indentation is enabled.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

참고

add a note add a note

User Contributed Notes 1 note

up
7
nemiga at gmail dot com
13 years ago
This param should be used only after openMemory() call:

<?php
$version
= '1.0';
$encoding = 'UTF-8';
$rootName = 'root';

$xml = new XMLWriter();              

$xml->openMemory();
$xml->setIndent(true);
$xml->startDocument($version, $encoding);
$xml->startElement($this->rootName);
// .. add more elements here
$xml->endElement();
echo
$xml->outputMemory();
?>
To Top