Combining numbers and strings for math

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gf

    #1

    Combining numbers and strings for math

    I'm sure I'll slap my forehead when I see the answer, but it is sure
    escaping me!

    $field1 = 100; //Some number
    $field2 = '/10'; //An operand and a divisor

    I need $result = to be a numeric representation of 100/5 = 20.

    I have fiddled with concatonation and eval() and haven't figured it out yet.
    What's the answer?

    Thanks.
    --
    Gaylen
    Raven Web Hosting http://ravenwebhosting.com
    PHP KISGB PHP Guest Book for Standard and phpNuke sites

    PHP KISSQ PHP Stock Quote for Standard and phpNuke sites



Working...