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, 17 May 2013

view this page in

xmlrpc_is_fault

(PHP 4 >= 4.3.0, PHP 5)

xmlrpc_is_faultDétermine si un tableau de valeurs représente un XMLRPC

Description

bool xmlrpc_is_fault ( array $arg )
Avertissement

Cette fonction est EXPERIMENTALE. Cela signifie que le comportement de cette fonction, son nom et, concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS ! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

Liste de paramètres

arg

Tableau retourné par la fonction xmlrpc_decode().

Valeurs de retour

Retourne TRUE si l'argument signifie fault, FALSE sinon. La description de fault est disponible dans la variable $arg["faultString"], le code de fault est disponible dans la variable $arg["faultCode"].

Exemples

Retrouvez un exemple avec la fonction xmlrpc_encode_request().

Voir aussi



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