Parameters
$key - The element key.
Returns
True if the key already exists, otherwise false.
Syntax
PHP |
public function HasKey($key) : bool
|
Indicates if a key already exists.
Example
PHP |
include_once "LJCRoot.php";
$prefix = RelativePrefix();
include_once "$prefix/GenTextLib/LJCGenTextSectionLib.php";
$replacements = new LJCReplacements();
$key = "ReplacementName";
if ($sections->HasKey($key))
{
throw new Exception("Key: {$key} already in use.");
}
else
{
$section = new LJCReplacement($key);
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.