简体   繁体   中英

list subdomain of a domain using cpanel xml api php

I am using cpanel xml api.

https://github.com/CpanelInc/xmlapi-php

i can create subdomains and delete them.

Now i want to list the subdomains.

Here is the Answer in API1 level

$listSubdomain = $xml->api1_query( $cp_un, 'SubDomain', 'listsubdomainsop');

$listSubdomainpaths = $xml->api1_query( $cp_un, 'SubDomain', 'cplistsubdomains');

You can use the following:

$subdomainsList = $xml->api2_query($cpanelUser, 'SubDomain', 'listsubdomains');

If you want, it is possible to filter results using a PCRE regex:

$subdomainsList = $xml->api2_query($cpanelUser, 'SubDomain', 'listsubdomains', [
    'regex' => '\bMySubdomain\b'
]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM