Re: [PHP] Mathmatical formula

2005-12-20 Thread Mike Smith
> Let's do an experiment. Place these two lines of code in a page, then load > it in a browser; > > > $foo = (36.0*58.0)/144; > echo $foo; > > ?> > > works fine for me. If you change > > > > to > > > Yep, that does work. Thanks Jay. Mike -- PHP General Mailing List (http://www.php.net/

RE: [PHP] Mathmatical formula

2005-12-20 Thread Jay Blanchard
[snip] > Try; > > $foo = preg_replace($find,$replace,$partFormula); > return $foo Unfortunately no. I also tried making the formula look like this: and returning it with: eval('?>' . $a . ' works fine for me. If you change to it also works. -- PHP General Mailing List (http://www.php.net

Re: [PHP] Mathmatical formula

2005-12-20 Thread Mike Smith
> Try; > > $foo = preg_replace($find,$replace,$partFormula); > return $foo Unfortunately no. I also tried making the formula look like this: and returning it with: eval('?>' . $a . 'http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Mathmatical formula

2005-12-20 Thread Jay Blanchard
[snip] I have an application that allows the users to input a formula: (Width*Height)/144 This formula gets updated with a part's specific width & height and actually returns: (36.0*58.0)/144 I use preg_replace to replace Width and Height with values from the following array: [Width] =>

[PHP] Mathmatical formula

2005-12-20 Thread Mike Smith
I have an application that allows the users to input a formula: (Width*Height)/144 This formula gets updated with a part's specific width & height and actually returns: (36.0*58.0)/144 I use preg_replace to replace Width and Height with values from the following array: [Width] => 36.000