[Phpwm] Fnuction to calculate a formula

David Goodwin david at codepoets.co.uk
Mon Dec 3 21:43:15 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Elliot Smith wrote:
> Colin Taylor wrote:
>> Hello,
>> I am on the hunt for a PHP 5 function that will calculate a given
>> formula.
>>   
> Providing users aren't supplying the input, eval() seems OK to me. Call
> me crazy if you like.
> 


I'd be tempted to go with eval - or alternatively perhaps you can use
something like 'bc' which /might/ allow you users to enter nasty
characters without the same fear of exploitation, but it's unlikely.

(Nothing on pecl.php.net that seems to jump out at me as being of use.)
(http://uk2.php.net/bc seems to be of limited use)

David.

- --
David Goodwin

[ david at codepoets dot co dot uk ]
[ http://www.codepoets.co.uk       ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHVHhY/ISo3RF5V6YRAgYaAKCfdePJrORRm3d/vOPFiwBVOh6XNACgj3D2
9r28n6DPclHe6RpG7l+quro=
=IID8
-----END PGP SIGNATURE-----



More information about the Phpwm mailing list