Search found 1 match
- Sun Jul 05, 2009 11:53 am
- Forum: PHP - Code
- Topic: Turn string into operator?
- Replies: 5
- Views: 189
Turn string into operator?
I am trying to write a function that will evaluate 2 values, but the operator can be dynamic. For example: function evaluate($value1, $operator, $value2) { if ($value1 { $operator } $value2) { return true; } else { return false; } } $test = evaluate(3, ">", 1); Is...