downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

xmlrpc_parse_method_descriptions> <xmlrpc_get_type
[edit] Last updated: Fri, 26 Apr 2013

view this page in

xmlrpc_is_fault

(PHP 4 >= 4.3.0, PHP 5)

xmlrpc_is_faultDetermines if an array value represents an XMLRPC fault

Description

bool xmlrpc_is_fault ( array $arg )
Warning

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

Parameters

arg

Array returned by xmlrpc_decode().

Return Values

Returns TRUE if the argument means fault, FALSE otherwise. Fault description is available in $arg["faultString"], fault code is in $arg["faultCode"].

Examples

See example by xmlrpc_encode_request().

See Also



add a note add a note User Contributed Notes xmlrpc_is_fault - [1 notes]
up
0
angelo at at dot com
2 years ago
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']);
    }
   
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites