K, I'll add [url] tags
No no, I had them as "<a href="viewtopic.php".... which obviously doesn't work if you're not in /forum.
okay, http://pear.php.net/package/Math_Complex/
can handle all the complex junk. do you want me too finish my script anyway?
can handle all the complex junk. do you want me too finish my script anyway?
Here's what I have. Can you try building it into this plz?
Code:
Code:
function matheval($equation){
$equation = preg_replace("/pi/","3.14159265",$equation);
$equation = preg_replace("/e/","2.718281835",$equation);
$equation = preg_replace("/([^0-9]+)\^([^0-9]+)/","",$equation);
$equation = preg_replace("/[^0-9+\-.*\/()%]/","",$equation);
$equation = preg_replace("/([+-])([0-9]+)(%)/","*(1\$1.\$2)",$equation);
// you could use str_replace on this next line
// if you really, really want to fine-tune this equation
$equation = preg_replace("/([0-9]+)(%)/",".\$1",$equation);
if ( $equation == "" ) {
$return = 0;
} else {
eval("\$return=" . $equation . ";");
}
return $return;
}
elfprince13 wrote:
dang it all. Im getting so confused....why can't php have built in support for it like python
rofl, thats why you should run python on your webserver
its for kerms....plus all my hosting is free and Ive never seen a free web host that supports python.
elfprince13 wrote:
its for kerms....plus all my hosting is free and Ive never seen a free web host that supports python.
hell, i don't know if my webhost supports python....
» Goto page Previous 1, 2, 3 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 3
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement