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: Fri, 25 May 2012

view this page in

xmlrpc_is_fault

(PHP 4 >= 4.3.0, PHP 5)

xmlrpc_is_fault配列の値が XMLRPC の失敗であるかどうかを調べる

説明

bool xmlrpc_is_fault ( array $arg )
警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

パラメータ

arg

xmlrpc_decode() が返す配列。

返り値

引数が失敗を表す場合に TRUE、それ以外の場合に FALSE を返します。 失敗の内容は $arg["faultString"]、失敗のコードは $arg["faultCode"] に格納されます。

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