本文整理汇总了PHP中jsonService函数的典型用法代码示例。如果您正苦于以下问题:PHP jsonService函数的具体用法?PHP jsonService怎么用?PHP jsonService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jsonService函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
<?php
include "../webserviceurl.php";
$url .= "IdentityTypeCreate";
$description = isset($_GET['description']) ? $_GET['description'] : null;
$arrParam = array();
if ($description != null) {
$arr = array("Description" => $description);
$arrParam = array_merge($arrParam, $arr);
}
include "../json.php";
$jsonData = jsonService($arrParam, $url);
$state = $jsonData->State;
$message = $jsonData->Message;
if ($message == "") {
echo "success";
} else {
echo $message;
}
示例2: array
-
<br/><br/>
<?php
include "json.php";
$param = array("Name" => "cater1", "Password" => "cater1");
$jsonData = jsonService($param, "http://localhost/KUGI/api/json/reply/CategoryRetrieve");
echo "<strong>http://localhost/KUGI/api/json/reply/CategoryRetrieve</strong><br/>";
echo json_encode($jsonData);
echo "<br/><br/>xxx<br/><br/>";
$jsonData = json_encode(jsonService($param, "http://localhost/KUGI/api/json/reply/CategoryRetrieve"));
echo $jsonData;
echo "<br/><br/>";
$array = array("nama" => "Rizal", "jenis_kelamin" => "Pria", "blog" => "http://wwdq.blogspot.com", "facebook" => "fb.com/riloaw.us", "twitter" => "twitter.com/riloaw");
$encode = json_encode($array);
//tampilkan hasil encode
echo "ini hasil json_encode ";
echo $encode;
echo "<br/><br/>";
$decode = json_decode($encode, true);
echo "ini contoh yang sudah di decode menjadi array = " . $decode;
//$decode['nama'];
?>