Onetastic Macro Documentation >
>
>
Array_RemoveByKey Array_RemoveByKey
Removes the element with the given key from the array. Returns true if the key existed in the array and the element is removed, false if the key didn't exist in the array.
Syntax
Bool Array_RemoveByKey(
byref Array array,
Mixed key)
Parameters
- Array array
- Array to remove the element from.
- Mixed key
- Key for the element to remove from the array.
Examples
$array = Array(10, 12, 14, 16, 18)
Array_RemoveByKey($array, 0)
Array_RemoveByKey($array, 3)
$array2["size"] = "large"
$array2["color"] = "red"
$array2["type"] = "t-shirt"
Array_RemoveByKey($array2, "type")
|