Re: [PHP] Evaluating math without eval()

2008-04-13 Thread Jason Norwood-Young
On Sat, 2008-04-12 at 09:05 -0500, Ray Hauge wrote: > > you might be able to leverage a call to expr on a bash sell. Just > replace the variables you're expecting with preg_replace or some similar > function. > > http://hacktux.com/bashmath > http://sysblogd.wordpress.com/2007/08/26/let-bash-

Re: [PHP] Evaluating math without eval()

2008-04-12 Thread Ray Hauge
Jason Norwood-Young wrote: On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: First post to this list! I'm trying to figure out how to evaluate a string with a mathematical expression and get a result, but without using eval() as I'm accepting user input into the string. I don't just want a

Re: [PHP] Evaluating math without eval()

2008-04-11 Thread Robin Vickery
On 10/04/2008, Jason Norwood-Young <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: > > > > First post to this list! I'm trying to figure out how to evaluate a > > > string with a mathematical expression and get a result, but without > > > using eval() as I'm a

Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jim Lucas
Jason Norwood-Young wrote: On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: First post to this list! I'm trying to figure out how to evaluate a string with a mathematical expression and get a result, but without using eval() as I'm accepting user input into the string. I don't just want a

Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young
On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: > > First post to this list! I'm trying to figure out how to evaluate a > > string with a mathematical expression and get a result, but without > > using eval() as I'm accepting user input into the string. I don't just > > want addition, subtr

Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young
On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: > > First post to this list! I'm trying to figure out how to evaluate a > > string with a mathematical expression and get a result, but without > > using eval() as I'm accepting user input into the string. I don't just > > want addition, subt

Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Richard Heyes
First post to this list! I'm trying to figure out how to evaluate a string with a mathematical expression and get a result, but without using eval() as I'm accepting user input into the string. I don't just want addition, subtraction, multiplication and division - I'd like to take advantage of oth

[PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young
Hi all First post to this list! I'm trying to figure out how to evaluate a string with a mathematical expression and get a result, but without using eval() as I'm accepting user input into the string. I don't just want addition, subtraction, multiplication and division - I'd like to take advantage