php string to number typecast code example Example: php typecast to int $num = "3.14"; $int = (int)$num; $float = (float)$num;