![]() |
| Register | Login | |||||
|
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
|
| | |||
| 0 users currently in Programming. |
| Acmlm's Board - I3 Archive - Programming - PHP String Question |
New poll | | ![]() |
| Add to favorites | Next newer thread | Next older thread |
| User | Post | ||
|
Juggling Joker Ninji SMW Mod Merry Christmas! Since: 11-18-05 Last post: 5935 days Last view: 5907 days |
| ||
| Is there a standard PHP function that will evaluate a string as a math function. What I mean, in case I wasn't clear, is this. Say you have "2+3" stored in a string. Is there a function you can run that string through that will return 5?
As always, thanks for the help. Note: While I am willing (and able) to write the necessary functions myself if necessary, I'd much prefer not to if I can avoid it. Edit: No rush now, I did manage to write my own basic math simplifier. It follows the same basic steps a human would (PEMDAS, left to right ordering). I love regular exp (edited by Juggling Joker on 12-02-05 04:15 PM) (edited by Juggling Joker on 12-02-05 06:30 PM) |
|||
|
OmnipotentEntity Newcomer Since: 12-03-05 Last post: 6100 days Last view: 6100 days |
| ||
| php does have the eval() function, which will do that, but you need to make extra sure to taint check before you run it. |
| Add to favorites | Next newer thread | Next older thread |
| Acmlm's Board - I3 Archive - Programming - PHP String Question |
| ![]() |