I am getting a value from database 67.00€
.I need to multiple this value with an integer. So, used explode
function of php to convert this to array and stored it in a variable $result
.
print_r()
is as follows:
Array
(
[0] => 67
[1] => 00€
)
Now, if i'm multiplying the first value of this array with any value, result is always 0. like:
$result[0]*12
i also tried to convert the first value to integer by using (int) $result[0]
and intval($result[0])
. Both output 0
What i am doing wrong?
Try this:
I have tried this and it worked for me. Please create a new file and run in localhost other that your project.
test.php
I don't know what you doing wrong. I hope from this you may able to detect your err.