maths from string?
Posted: Mon Nov 06, 2006 9:22 am
Hi I have a problem
I am writing a voucher script for my website. I need to perform a maths equation on a string. e.g
$var1 = "/2"; (string)
$var2 = "20"; (int)
I need to perform the string function on the int to make $amount = (20 / 2); I could have various strings e.g $var could be "-10"; or "*3"
then store that as a variable.
Am i making sense?
I am writing a voucher script for my website. I need to perform a maths equation on a string. e.g
$var1 = "/2"; (string)
$var2 = "20"; (int)
I need to perform the string function on the int to make $amount = (20 / 2); I could have various strings e.g $var could be "-10"; or "*3"
then store that as a variable.
Am i making sense?