How to convert 1/4 to 0.25
in PHP.
In form I insert number as 1/4
. In action page
I get the post variable as 1/4
.
How can I convert this to 0.25
. I think in action page this is obtained as string. Thats why it displayed as 1/4
. But I need 0.25.
How can I do this??
main page
<input type="text" name="a" id="a">
action page
$a = $_POST['a'];
echo $a; //gives 1/4 but need 0.25
Please help..