Download the PHP package phoenix-robotix/php-json-toolkit without Composer
On this page you can find all versions of the php package phoenix-robotix/php-json-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download phoenix-robotix/php-json-toolkit
More information about phoenix-robotix/php-json-toolkit
Files in phoenix-robotix/php-json-toolkit
Download phoenix-robotix/php-json-toolkit
More information about phoenix-robotix/php-json-toolkit
Files in phoenix-robotix/php-json-toolkit
Vendor phoenix-robotix
Package php-json-toolkit
Short Description A simple php library to work with JSON data
License
Package php-json-toolkit
Short Description A simple php library to work with JSON data
License
Please rate this library. Is it a good library?
Informations about the package php-json-toolkit
php-json-toolkit
A simple php library to work with JSON data.
Usage
Initialize an object to work with
Get value of a key
Get objects matching certain criteria
Class
PR_JSON_TOOL_KIT
Properties
$data
- Private
- Associative array
- Parsed JSON data to work with
$key_separator
- Private
- String
- The separator string to use for parsing a multi-level key.
Ex:
To get the value of "d"
from the above JSON data, the key will be passed as follows:
b{key_separator}d
Methods
__construct
__construct (string $json_string = '[]', string $key_separator = ':')
- Public
- Constructor function
- Parameters
- $json_string
The JSON string to parse and use as the data source($data)
Default value:'[]'
- $key_separator
The separator string to use for parsing a multi-level key
Default value:':'
- $json_string
- Return values
- Returns nothing
get_value_of
public mixed get_value_of (string $key, string $json_data="")
- Public
- Get value of a key from the json data
- Parameters
- $key
The key to search for in the data source($data)
The key may be a simple key("key")
or a multi-level key where the keys are separated by the$key_separator ("lvl_1:lvl_2:lvl_3")
- $json_data
The JSON string to parse and use as the data source($data)
If no string provided, then the data source initialized by the constructor function will be used.
- $key
- Return values
- Returns the value of the key on success
- Returns
false
if key not found
get_data
public array get_data (array $search_key_values, array $return_value_of_keys=[], string $json_array="")
- Public
- Get an array of objects(or the values of specific keys of the objects) having a particular key=>value pair out of an array of objects
- Parameters
- $search_key_values
An array containing thekey => value
pairs to search for - $return_value_of_keys
An array containing the keys whose values to be returned if a match found.
If no key specified, then the entire matched objects will be returned. - $json_array
The JSON string to parse and use as the data source
($data)
If no string provided, then the data source initialized by the constructor function will be used.
- $search_key_values
- Return values
- Returns an array containing the objects with required key value pairs of the matched objects
- Returns an empty array
([])
if no match found
All versions of php-json-toolkit with dependencies
PHP Build Version
Package Version
No informations.
The package phoenix-robotix/php-json-toolkit contains the following files
Loading the files please wait ....