GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Settings/Helpers.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @license GPL-2.0-or-later
4  *
5  * Modified by gravityview on 13-January-2023 using Strauss.
6  * @see https://github.com/BrianHenryIE/strauss
7  */
8 
10 
11 class Helpers {
12  /**
13  * Compares 2 values using an operator.
14  *
15  * @see UI/src/lib/validation.js
16  *
17  * @param string $first
18  * @param string $second
19  * @param string $op
20  *
21  * @return bool
22  */
23  static function compare_values( $first, $second, $op ) {
24  switch ( $op ) {
25  case '!=':
26  return $first != $second;
27  case '>':
28  return (int) $first > (int) $second;
29  case '<':
30  return (int) $first < (int) $second;
31  case 'pattern':
32  return preg_match( '/' . $first . '/', $second );
33  case '=':
34  default:
35  return $first == $second;
36  }
37  }
38 }
static compare_values( $first, $second, $op)
Compares 2 values using an operator.