<?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; }
- <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']; ?>