Loading
A beginner-friendly guide to the JSON functions in BDFD
Parsing, reading, writing, and inspecting a JSON object
Working with JSON arrays
Store structured data in a single BDFD variable
$jsonParse
Parses a JSON string into an object for use by other functions
$json
Retrieves a value from the current JSON object by key
$jsonSet
Sets or replaces a value at the specified key
$jsonSetString
Sets or replaces a value at the specified key, always as a string
$jsonUnset
Removes a key and its value from the JSON object
$jsonClear
Clears the entire current JSON object
$jsonExists
Checks if a key exists in the current JSON object
$jsonStringify
Converts the current JSON object back into a string
$jsonPretty
Converts the current JSON object into a formatted, readable string
$jsonArray
Marks a key as an array
$jsonArrayCount
Returns the number of elements in a JSON array
$jsonArrayIndex
Returns the index of a value in a JSON array
$jsonArrayAppend
Appends a value to the end of a JSON array
$jsonArrayPop
Removes and returns the last element of a JSON array
$jsonArrayShift
Removes and returns the first element of a JSON array
$jsonArrayUnshift
Adds a value to the front of a JSON array
$jsonArraySort
Sorts a JSON array in ascending order
$jsonArrayReverse
Reverses the order of a JSON array
$jsonJoinArray
Joins all elements of a JSON array into a string with a separator
If you're completely new, start with these two functions in order: