Page 1 of 1
how to evaluate php code in string
Posted: Thu Jun 21, 2007 11:28 pm
by ali_engr
I am arithimatical expression in data base field like "sqrt(4)/5+10" , how i can get the result of expression as it is a string. how to evaluate string as php code.
regards,
Posted: Thu Jun 21, 2007 11:33 pm
by feyd
eval(), but it's quite dangerous to use. I would suggest you look into the math expression engines which are available in various forms and complexities.
RE:
Posted: Thu Jun 21, 2007 11:36 pm
by ali_engr
It may not only the pure arithimatical expresion, may be some more php function call as well. so if any body have any idea, [s]plz[/s]
please guide me.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Posted: Thu Jun 21, 2007 11:38 pm
by feyd