You are here

function rules_forms_equal_array_values in Rules Forms Support 7.2

Same name and namespace in other branches
  1. 7 includes/rules_forms.eval.inc \rules_forms_equal_array_values()

Compare two arrays values regardless of their elements order.

Parameters

array $array1: An array to compare against $array2.

array $array2: An array to compare against $array1.

Return value

bool TRUE if both arrays are equal regardless of their elements order.

2 calls to rules_forms_equal_array_values()
rules_forms_condition_attribute_value in includes/rules_forms.eval.inc
Condition: Form element attribute has value.
rules_forms_condition_element_value in includes/rules_forms.eval.inc
Condition: Form element has value.

File

includes/rules_forms.eval.inc, line 149
Evaluation functions for Rules Forms module.

Code

function rules_forms_equal_array_values($array1, $array2) {
  $diff1 = array_diff($array1, $array2);
  $diff2 = array_diff($array2, $array1);
  return empty($diff1) && empty($diff2);
}