note 102062 added to function.xmlrpc-is-fault
| From: | angelo at at dot com | Date: | Tue, 25 Jan 2011 20:31:26 +0000 |
| Subject: | note 102062 added to function.xmlrpc-is-fault | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176303@lists.php.net to get a copy of this message | ||
A note, response from xmlrpc_decode is not always an array. Whenever the XMLRPC server returns a
string, xmlrpc_is_fault will complain about not being an array.
Best way to detect errors is
<?php
$response = xmlrpc_decode($file);
if (is_array($response) && xmlrpc_is_fault($response)) {
throw new Exception($response['faultString'], $response['faultCode']);
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 98.174.160.180
----
Manual Page -- http://www.php.net/manual/en/function.xmlrpc-is-fault.php
Edit -- https://master.php.net/note/edit/102062
Del: integrated -- https://master.php.net/note/delete/102062/integrated
Del: useless -- https://master.php.net/note/delete/102062/useless
Del: bad code -- https://master.php.net/note/delete/102062/bad+code
Del: spam -- https://master.php.net/note/delete/102062/spam
Del: non-english -- https://master.php.net/note/delete/102062/non-english
Del: in docs -- https://master.php.net/note/delete/102062/in+docs
Del: other reasons-- https://master.php.net/note/delete/102062
Reject -- https://master.php.net/note/reject/102062
Search -- https://master.php.net/manage/user-notes.php