In php are characters and integers compatible code example Example: php to int $num = "3.14"; $int = (int)$num;