Skip to content
Miky edited this page Sep 10, 2015 · 2 revisions

This is an Output Filter for XML strings.

Usage

Use it with DonDominioResponse, via the output() method:

$options = array();

$data = $response->output('XML', $options);

Options

Option Type Required? Default Description
pretty boolean No false Outputs the XML preserving the format instead of on a single line (adding tabs and spaces)

Example output

PHP:

$dondominio = new DonDominio(array(
	'apiuser' => '00000-XXX',
	'apipasswd' => 'XXXXXXXXXXXX'
));

$domainCheck = $dondominio->domain_check('example.com');

$xml = $domainCheck->output('XML', array('pretty'=>true));

echo $xml;

Output:

<?xml version="1.0"?>
<data>
  <domains>
    <0>
      <name>default.com</name>
      <punycode>default.com</punycode>
      <tld>com</tld>
      <available/>
      <premium/>
      <price>9.95</price>
      <currency>EUR</currency>
    </0>
  </domains>
</data>

Clone this wiki locally