mormat / php-formula-interpreter

PHP library for parsing and running formulas from a string
GNU General Public License v2.0
5 stars 5 forks source link

Add the 'in' operator #5

Closed mormat closed 1 year ago

mormat commented 1 year ago

The operator in checks if a value is embedded into another value It should look like this

first_value in second_value

If the second value is a string, it checks this string contains a substring Example

'and' in 'War and Peace'

If the second value is an array, it checks this array contains a specific item Example

2 in [1, 2, 3]