Thread: String Parsing
View Single Post
  #7  
Old 03-20-2008, 09:57 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Programmer View Post
I believe he's trying to do something like so:

PHP Code:
temp.var1 4;
temp.str "temp.var1 + 1";
temp.value int(temp.str);

echo(
temp.value);

// he wants it to return 5, but it returns -1, naturally. 
Would be interesting to figure this out. Graal needs an eval() function.
I don't see why we need to parse a string if we're doing simple math...
text*15 or float(text)*15 should suffice, but if there's something I'm missing here, might I recommend this script (though I hate to plug my own script ). It has the necessary code to do this, probably
PHP Code:
temp.result where_param_format("","",whatever_text,15,"times"); 
Not totally sure on this though.

Though, I'm willing to help make a limited eval() if there is enough demand for it.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 03-20-2008 at 10:19 AM..
Reply With Quote