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

This is an Output Filter for JSON strings.

Usage

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

$options = array();

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

Options

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

Example output

PHP:

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

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

$json = $domainCheck->output('JSON', array('pretty'=>true));

echo $json;

Output:

{
    "domains": [
        {
            "name": "default.com",
            "punycode": "default.com",
            "tld": "com",
            "available": false,
            "premium": false,
            "price": 9.95,
            "currency": "EUR"
        }
    ]
}

Clone this wiki locally