values

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

{	
  a: values({name: 'Juliet', age: `13`}),
  b: values(`{}`),
  c: values(`false`),
  d: values(['b', 'a', 'c'])
}
{
  "a": [
    "Juliet",
    13
  ],
  "b": []
}