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

search for in the

xmlrpc_parse_method_descriptions> <xmlrpc_get_type
[edit] Last updated: Sat, 07 Jan 2012

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

설명

bool xmlrpc_is_fault ( array $arg )
Warning

이 함수는 실험적입니다. 이 함수의 작동, 함수의 이름, 그리고 관련된 모든 문서는 이후의 PHP 릴리즈에서 예고 없이 변경할 수 있습니다. 이 함수의 사용에 관한 것은 사용자 책임입니다.

인수

arg

Array returned by xmlrpc_decode().

반환값

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

예제

See example by xmlrpc_encode_request().

참고



add a note add a note User Contributed Notes xmlrpc_is_fault
angelo at at dot com 25-Jan-2011 12:31
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