Re: [PHP] Evaluating math without eval()

2008-04-14 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

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

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 accepting

[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

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

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,

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, subtraction,

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