You are here

public static function WebformArrayHelper::inArray in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformArrayHelper.php \Drupal\webform\Utility\WebformArrayHelper::inArray()

Determine if any values are in an array.

Parameters

array $needles: The searched values.

array $haystack: The array.

Return value

bool TRUE if any values are in an array.

See also

http://stackoverflow.com/questions/7542694/in-array-multiple-values

1 call to WebformArrayHelper::inArray()
WebformFormHelper::processStates in src/Utility/WebformFormHelper.php
Adds JavaScript to change the state of an element based on another element.

File

src/Utility/WebformArrayHelper.php, line 71

Class

WebformArrayHelper
Provides helper to operate on arrays.

Namespace

Drupal\webform\Utility

Code

public static function inArray(array $needles, array $haystack) {
  return !!array_intersect($needles, $haystack);
}