1$stringVal = "12.06";
2$stringConvertedToFloat = floatval( $stringVal );
3// The floatval function will return the argument converted
4// to a float value if the value can be converted.
5// IF the value cannot be converted these are the values that will be
6// returned:
7// Empty Array: returns 0. eg: floatval([]);
8// Non-Empty Array: returns 1. eg: floatval(["ab", "12"])
9// String with a non-numeric value as the left most character: returns 0. eg: floatval("ab12")
10// String with one or more numeric values as the left most characters: returns those characters as a float. eg: floatval("12ab1") will return 12.
11// Oh the joys of php
1$num = "3.14";
2$int = (int)$num;//string to int
3$float = (float)$num;//string to float