K, I'll add [url] tags
cool.
Url tags added. Now for the "new post" relative links.
relavtive links to save bandwidth?
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?
Here's what I have. Can you try building it into this plz?

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;
}
sure.
Awesomeness. Can't wait. Smile
I gotta say, i is a tricky little bugger.
eh? What do you mean? Very Happy
whoops...I meant i

EDIT:

wtf, phpB keeps capitalizing everything
don't forget the long lines problem!

you keep ignoring me every time i mention that Razz
elfprince: that's a phpBB feature to prevent noobish uncapitalization of 'I'. :
I am now booting up my home copy of apache to do some work on i in a good editor.
dang it all. Im getting so confused....why can't php have built in support for it like python Sad
elfprince13 wrote:
dang it all. Im getting so confused....why can't php have built in support for it like python Sad


rofl, thats why you should run python on your webserver Wink
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....
I'm pretty sure Google has some python scripts they use.
  
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

 

Advertisement