Skip to main content

Name

hash_get — get the value associated with the specified key

Synopsis

hash_get { $hash } { $key }

Description

Get the value of the specified key from a hash. Hash keys must be strings or expressions that resolve to strings.

Sieve scripts using hash_get can be used in any phase.

**Configuration Change. ** This feature is available starting from Momentum 3.0.16.

Since 3.0.17, passing an incorrect value to this function returns an error message. Previously, no error was returned.

$hash = hash_create;
  hash_set $hash "mykey" "myvalue";
  $value = hash_get $hash "mykey";

See Also

Was this page helpful?