-
Notifications
You must be signed in to change notification settings - Fork 53
JSON_GET_STR
Jurek Muszyński edited this page Sep 11, 2018
·
4 revisions
Retrieves string value from JSON object. If name is of different type (i.e. integer) then string representation will be returned.
Pointer to the string. If the element of required name doesn't exist, empty string is returned.
OUT("<p>Name: %s</p>", JSON_GET_STR(json, "name"));
// if "age" is of type integer, both will work:
OUT("<p>Age: %d</p>", JSON_GET_INT(json, "age"));
OUT("<p>Age: %s</p>", JSON_GET_STR(json, "age"));