2016-09-12 10:30:05 +02:00
|
|
|
{
|
|
|
|
"name": "array_get",
|
|
|
|
"type": "function",
|
2020-07-02 01:46:48 +01:00
|
|
|
"groups": ["Arrays"],
|
2020-11-09 15:10:13 -05:00
|
|
|
"description": "Returns the Nth value (0 for the first one) or the last -Nth value (-1 for the last one) of an array.",
|
2022-01-07 08:33:29 -05:00
|
|
|
"arguments": [{
|
|
|
|
"arg": "array",
|
|
|
|
"description": "an array"
|
|
|
|
}, {
|
2022-09-29 21:39:51 +02:00
|
|
|
"arg": "pos",
|
2022-01-07 08:33:29 -05:00
|
|
|
"description": "the index to get (0 based)"
|
|
|
|
}],
|
|
|
|
"examples": [{
|
|
|
|
"expression": "array_get(array('a','b','c'),1)",
|
|
|
|
"returns": "'b'"
|
|
|
|
}, {
|
|
|
|
"expression": "array_get(array('a','b','c'),-1)",
|
|
|
|
"returns": "'c'"
|
|
|
|
}],
|
2022-01-11 11:17:49 -05:00
|
|
|
"tags": ["array", "position", "index", "last", "nth", "one", "first"]
|
2016-09-12 10:30:05 +02:00
|
|
|
}
|