xmlrpc_is_fault

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

xmlrpc_is_faultBir dizinin bir XMLRPC hatasını gösterip göstermediğini tespit eder

Açıklama

xmlrpc_is_fault(array $dizi): bool
Uyarı

Bu işlev DENEYSELDİR. Bu işlevin davranışı, ismi ve belgeleri PHP'nin sonraki sürümlerinde hiçbir duyuru yapılmaksızın değiştirilebilir. Bu risk göze alınamayacaksa bu işlev kullanılmamalıdır.

Bağımsız Değişkenler

dizi

xmlrpc_decode() ile döndürülmüş bir dizi.

Dönen Değerler

$dizi bir hata içeriyorsa true, aksi takdirde false döner. Hatanın koduna $dizi["faultCode"], açıklamasına ise $dizi["faultString"] ile erişilir.

Örnekler

xmlrpc_encode_request() işlevindeki örneğe bakınız.

Ayrıca Bakınız

add a note

User Contributed Notes 1 note

up
1
angelo at at dot com
13 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']);
}

?>
To Top