php typecast to number with decimal code example
Example 1: string to decimal php
$num = (double) "10.12";
Example 2: php typecast to int
$num = "3.14";
$int = (int)$num;
$float = (float)$num;
$num = (double) "10.12";
$num = "3.14";
$int = (int)$num;
$float = (float)$num;