Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
beautify php code snippet
  • Loading branch information
ksinwx authored Mar 20, 2019
1 parent f743340 commit f65b574
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,35 @@ Example
-------

```php
require "domrobot.class.php";
<?php

require 'domrobot.class.php';
// Config
$addr = "https://api.ote.domrobot.com/xmlrpc/";
$usr = "your_username";
$pwd = "your_password";
$addr = 'https://api.ote.domrobot.com/xmlrpc/';
$usr = 'your_username';
$pwd = 'your_password';

// Create Domrobot and Login
$domrobot = new INWX\Domrobot($addr);
$domrobot->setDebug(false);
$domrobot->setLanguage('en');
$res = $domrobot->login($usr,$pwd);
$res = $domrobot->login($usr, $pwd);

//Make an API Call
if ($res['code']==1000) {
$obj = "domain";
$meth = "check";
$params = array();
$params['domain'] = "mydomain.com";
$res = $domrobot->call($obj,$meth,$params);
print_r($res);
if ($res['code'] == 1000) {
$obj = 'domain';
$meth = 'check';
$params = [];
$params['domain'] = 'mydomain.com';
$res = $domrobot->call($obj, $meth, $params);
print_r($res);
} else {
print_r($res);
print_r($res);
}

//Logout
$res = $domrobot->logout();

```

You can also look at the example.php in the Project.
Expand Down

0 comments on commit f65b574

Please sign in to comment.