Re: Turning a string into a condition
| From: | Marco Behnke | Date: | Thu, 16 Feb 2012 23:03:15 +0000 |
| Subject: | Re: Turning a string into a condition | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316644@lists.php.net to get a copy of this message | ||
Am 16.02.12 22:37, schrieb Marc Guay:
> 2) The range of possibilities are broader than I indicated. They would
> like to be able to enter conditions of all sorts. i.e. ($x / $y) > 0.5
> (($a+$b+$c) / $d) < .75 etc. If you have any suggestions on how to
> increase the security while maintaning the flexibility, I'd be happy
> to hear it. Marc
Is math all you want to use? Parsing will be an easy doing and I am
pretty sure there are a lot of examples around the web.
E.g.:
http://www.phpclasses.org/package/2695-PHP-Safely-evaluate-mathematical-expressions.html
--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
e-Mail: marco@behnke.biz
Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal
http://www.behnke.biz
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc