Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Array Functions > Array_KeyExists

Array_KeyExists

Returns whether a given key exists or not in the given array.

Syntax

Array Array_KeyExists(
	Array array, 
	Mixed key)

Parameters

Array array
Array to look for the key in.
Mixed key
Key to look for.

Examples

$array = Array(3, 89, 47, 21, 23) $found3 = Array_KeyExists($array, 3) $found7 = Array_KeyExists($array, 7) // $found3 is true, $found7 is false // You can use this on arrays with string keys as well: $array["color"] = "red" $array["size"] = "large" $foundSize = Array_KeyExists($array, "size") $foundType = Array_KeyExists($array, "type") // $foundSize is true, $foundType is false

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions