What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-03-27 14:05:06
Convert an Array to a String in PHP
phpCopy<?php $array = ["Lili", "Rose", "Jasmine", "Daisy"]; $JsonObject = serialize($array); echo "The array is converted to the Json string."; echo "\n"; echo"The Json st... Add solution -
Kotlin 2022-03-16 13:50:04
okhttp kotlin example
val BASE_URL = "https://api.unsplash.com" val ACCESS_KEY = "..." val path = "/photos/$id" val uri = Uri.parse(BASE_URL) .buildUpon() .appendEncodedPath(path) //.appendPath(path) .build() val client = OkHttpC... Add solution -
Java 2022-02-18 23:30:11
JsonArray get first Object
private static int FIRST_ELEMENT = 0; public static void main(String[] args) { JSONArray json = new JSONArray("[{\"Hello1\":\"1\"},{\"Hello2\":\"2\"}]"); if (json.length() > 0) { Syste... Add solution -
Javascript 2022-02-10 14:30:02
convert json into map in java example
public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException { Map<String, Object> retMap = new HashMap<String, Object>(); if(json != JSONObject.NULL) { retMap = toMap(json); } return retMap;... Add solution -
Javascript 2022-02-02 19:41:34
okhttp3 application/json get kotlin
val BASE_URL = "https://api.unsplash.com" val ACCESS_KEY = "..." val path = "/photos/$id" val uri = Uri.parse(BASE_URL) .buildUpon() .appendEncodedPath(path) //.appendPath(path) .build() val client = OkHttpC... Add solution -
Other 2022-01-30 18:41:36
json parse java
import org.json.*; String jsonString = ... ; //assign your JSON String here JSONObject obj = new JSONObject(jsonString); String pageName = obj.getJSONObject("pageInfo").getString("pageName"); JSONArray arr = obj.getJSONArray("po... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5