(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
09-22-24 07:39 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - PHP String Question
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
OmnipotentEntity
Posts: 1/3
php does have the eval() function, which will do that, but you need to make extra sure to taint check before you run it.
Juggling Joker
Posts: 7/225
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 expressions.
Acmlm's Board - I3 Archive - Programming - PHP String Question


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.003 seconds; used 344.23 kB (max 373.08 kB)