
XMLWriter::outputMemory 메서드는 XML 문서를 메모리에 출력하는 메서드입니다. 이 메서드를 호출하면 XML 문서가 메모리에 저장되며, 메모리에서 XML 문서를 삭제하는 것이 아닙니다.
이 메서드는 XML 문서를 메모리에 출력한 후 메모리에서 XML 문서를 삭제하지 않습니다. 이 메서드는 XML 문서를 메모리에 출력한 후 XML 문서를 반환하는 메서드입니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$xml = new XMLWriter();
$xml->openMemory();
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('root');
$xml->endElement();
$xml->endDocument();
$xmlString = $xml->outputMemory();
위 코드에서 `$xmlString`에는 XML 문서가 저장됩니다.
2025-07-21 08:58