Separating simple rules from PHP code

RapidCentral

New Member
At the moment I have some PHP which sets a single variable based on the value of other independent variables in a linear format, like so:\[code\]$result = 0;if ($var1 == 'X') { $result += 10;}if ($var2 < 10) { $result += 15;}elseif ($var2 > 50) { $result -= 50;}// more of the same\[/code\]However, I'd like to be able to express these rules in a less programming-like way, mainly so that someone who doesn't know how to program can add/edit rules, and also because I might want to use the same rules in a Python or Perl script, without having to maintain copies in multiple languages. I could write my own simple language (for want of a better word) and parser, but I'd prefer to use an existing solution as that saves work and increases the likelihood that other people will know how to write rules in it.Is there a sensible/obvious choice for this sort of task?
 
Back
Top