i manipulate whmcs API to search for a DOC and print results.
<?php
/* *** WHMCS XML API Sample Code *** */
$clientId = $_POST['clienteId'];
$url = "https://westhost.com.br/painel/includes/api.php"; # URL to. WHMCS API file goes here
$username = "root"; # Admin username goes here
$password = "sadsadsadsa"; # Admin password goes here
$postfields = array();
$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "getclientsdetailsbydoc";
$postfields["clientDoc"] = $clientId;
$postfields["stats"] = false;
$postfields["responsetype"] = "xml";
query_string = "";
foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$xml = curl_exec($ch);
if (curl_error($ch) || !$xml) $xml = '<whmcsapi><result>error</result>'.
curl_errno($ch).' - '.curl_error($ch).'</curlerror></whmcsapi>';
curl_close($ch);
$arr = whmcsapi_xml_parser($xml); # Parse XML
if( isset($_POST['Pesquisar']) ) {
echo '<pre>'; print_r($arr); echo '</pre>'; # Output XML Response as ArraY
}
?>
And the Result is Above, How Can I tell XML to ONLY SHOW [FIRSTNAME [LASTNAME] and CUSTOMFIELDS1 in the Print ..................................................................................
Array
(
[WHMCSAPI] => Array
(
[ACTION] => getclientsdetailsbydoc
[RESULT] => success
[CLIENT] => Array
(
[USERID] => 3139
[ID] => 3139
[UUID] => 248d425a-04b1-452c-ab46-428fbb9c44f1
[FIRSTNAME] => Luiz Henrique
[LASTNAME] => A de Souza
[FULLNAME] => Luiz Henrique A de Souza
[COMPANYNAME] => lionconsultoria
[EMAIL] => luizhas@gmail.com
[ADDRESS1] => Cabo Frio
[ADDRESS2] =>
[CITY] => Cabo Frio
[FULLSTATE] => RJ
[STATE] => RJ
[POSTCODE] => 28970000
[CUSTOMFIELDS1] => 28391656764
[CUSTOMFIELDS] => Array
(