values
TABLE OF CONTENTS
Get an array of the values of an object
Definition
array values(object $obj)
Returns an array containing the keys of the provided object. Note that, because JSON hashes are inherently unordered, the values associated with $obj are inherently unordered.
Parameters
object $obj
Object to return the values of.
Returns
array
Array of the values of $obj.
Examples
Transformation
{
a: values({name: 'Juliet', age:`13`}),
b: values(`{}`),
c: values(`false`),
d: values(['b', 'a', 'c'])
}Result
{
"a": [
"Juliet",
13
],
"b": []
}Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article